只处理资源库的文件
This commit is contained in:
parent
f86acbb10f
commit
d2eb51bbb6
|
@ -259,11 +259,12 @@ class Attachment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def office_conver
|
def office_conver
|
||||||
|
return unless %w(Project Course).included? (self.container_type)
|
||||||
saved_path = File.join(Rails.root, "files", "convered_office")
|
saved_path = File.join(Rails.root, "files", "convered_office")
|
||||||
unless Dir.exist?(saved_path)
|
unless Dir.exist?(saved_path)
|
||||||
Dir.mkdir(saved_path)
|
Dir.mkdir(saved_path)
|
||||||
end
|
end
|
||||||
convered_file = File.join(saved_path, self.disk_filename + ".html")
|
convered_file = File.join(saved_path, self.disk_filename + ".pdf")
|
||||||
OfficeConverTask.new.conver(self.diskfile, convered_file)
|
OfficeConverTask.new.conver(self.diskfile, convered_file)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue