]> source.dussan.org Git - redmine.git/commitdiff
Makes the folder for attachments storage configurable in config/configuration.yml...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 23 Jan 2011 10:41:43 +0000 (10:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 23 Jan 2011 10:41:43 +0000 (10:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4755 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/attachment.rb
config/configuration.yml.example

index 99e461dc8a837fb24390c35a8840ca1dfea25a7b..93a1534e544df25c09a53903869c1654f0618279 100644 (file)
@@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base
                                                         "LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
 
   cattr_accessor :storage_path
-  @@storage_path = "#{RAILS_ROOT}/files"
+  @@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{RAILS_ROOT}/files"
   
   def validate
     if self.filesize > Setting.attachment_max_size.to_i.kilobytes
index 4baaeff52bbddd399625fbc4bb1a91d8ab631f86..673c25ae7d056110808744556452cd7b8ac7fbd4 100644 (file)
@@ -79,6 +79,7 @@
 
 # default configuration options for all environments
 default:
+  # Outgoing emails configuration (see examples above)
   email_delivery:
     delivery_method: :smtp
     smtp_settings:
@@ -89,6 +90,15 @@ default:
       user_name: "redmine@example.net"
       password: "redmine"
   
+  # Absolute path to the directory where attachments are stored.
+  # The default is the 'files' directory in your Redmine instance.
+  # Your Redmine instance needs to have write permission on this
+  # directory.
+  # Examples:
+  # attachments_storage_path: /var/redmine/files
+  # attachments_storage_path: D:/redmine/files
+  attachments_storage_path:
+  
 # specific configuration options for production environment
 # that overrides the default ones
 production: