Feature #4493
closedMake destination folder for attachment uploads configurable
0%
Description
Would it be possible to change app/models/attachment.rb
in such a way, that the destination folder can be configured? Currently it is defined as
@@storage_path = "#{RAILS_ROOT}/files"
This would be reasonable in Redmine deployments where one uses jruby and Redmine created as a JavaWebArchive with a Java application-server like Apache Tomcat. In this case the destination folder for the attachment uploads is a subfolder under $CATALINA_HOME/webapps/redmine.war/WEB-INF/files
. The problem with this is that the uploaded files would disappear after deploying a new version of Redmine unless one copies the files to the #{RAILS_ROOT}/files
directory before creating the WAR file.
Related issues
Updated by Vinod Singh almost 15 years ago
+1
IMO having a separate directory for each project would be good. Our Redmine instance has > 5,000 attachment, which is increasing rapidly. Having so many files in single directory may become a probelm.
Updated by Mischa The Evil almost 15 years ago
- Status changed from New to Closed
- Resolution set to Duplicate
Closed as a duplicate of #1236.
Updated by vik pro over 12 years ago
def diskfile
#"#{@storage_path}/#{self.disk_filename}"
@storage_path}/#{self.disk_filename}"
#"#{
path = "#{self.storage_path}/#{self.project.identifier}/#{self.disk_filename}"
path_dir = "#{self.storage_path}/#{self.project.identifier}"
Dir.mkdir(path_dir) unless File.directory?(path_dir)
path
end
Make like that. in attachment.rb in app/model/
in configuration faile you can channge atchment_storage_path to you folder(example nfs on NAS) and all attachmet must be in one place on NAS