Permission denied @ dir_s_mkdir
This commit is contained in:
parent
e5f3c30a82
commit
e5bb2d30b6
@ -96,7 +96,7 @@ class DmsfFile < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.storage_path
|
||||
path = Setting.plugin_redmine_dmsf['dmsf_storage_directory']
|
||||
path = Setting.plugin_redmine_dmsf['dmsf_storage_directory'].strip
|
||||
if path.blank?
|
||||
path = Pathname.new('files').join('dmsf')
|
||||
else
|
||||
|
||||
@ -153,13 +153,16 @@ class DmsfFileRevision < ActiveRecord::Base
|
||||
|
||||
def storage_base_path
|
||||
time = self.created_at || DateTime.now
|
||||
path = time.strftime('%Y/%m')
|
||||
DmsfFile.storage_path.join path
|
||||
DmsfFile.storage_path.join(time.strftime('%Y')).join(time.strftime('%m'))
|
||||
end
|
||||
|
||||
def disk_file(search_if_not_exists = true)
|
||||
path = self.storage_base_path
|
||||
FileUtils.mkdir_p(path) unless File.exist?(path)
|
||||
begin
|
||||
FileUtils.mkdir_p(path) unless File.exist?(path)
|
||||
rescue Exception => e
|
||||
Rails.logger.error e.message
|
||||
end
|
||||
filename = path.join(self.disk_filename)
|
||||
if search_if_not_exists
|
||||
unless File.exist?(filename)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user