Project

General

Profile

Actions

Feature #4493

closed

Make destination folder for attachment uploads configurable

Added by Drazen Baic about 14 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
2009-12-28
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate

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

Is duplicate of Redmine - Feature #1236: Make destination folder for attachment uploads configurableClosed2008-05-14

Actions
Has duplicate Redmine - Feature #2231: Ability to specify where files are stored on the filesystemClosed2008-11-26

Actions
Actions #1

Updated by Vinod Singh about 14 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.

Actions #2

Updated by Mischa The Evil about 14 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Closed as a duplicate of #1236.

Actions #3

Updated by vik pro almost 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

Actions

Also available in: Atom PDF