diff -U3 -r redmine-0.7.0/app/models/attachment.rb /var/www/html/redmine/app/models/attachment.rb --- redmine-0.7.0/app/models/attachment.rb 2008-04-28 06:41:30.000000000 -0400 +++ /var/www/html/redmine/app/models/attachment.rb 2008-05-15 09:46:15.000000000 -0400 @@ -28,8 +28,12 @@ acts_as_event :title => :filename, :url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}} - cattr_accessor :storage_path - @@storage_path = "#{RAILS_ROOT}/files" +# cattr_accessor :storage_path +# @@storage_path = "#{RAILS_ROOT}/files" + + def storage_path + Setting.attachment_storage_path || "#{RAILS_ROOT}/files" + end def validate errors.add_to_base :too_long if self.filesize > Setting.attachment_max_size.to_i.kilobytes @@ -75,7 +79,8 @@ # Returns file's location on disk def diskfile - "#{@@storage_path}/#{self.disk_filename}" +# "#{@@storage_path}/#{self.disk_filename}" + "#{self.storage_path}/#{self.disk_filename}" end def increment_download diff -U3 -r redmine-0.7.0/app/views/settings/_general.rhtml /var/www/html/redmine/app/views/settings/_general.rhtml --- redmine-0.7.0/app/views/settings/_general.rhtml 2008-04-28 06:41:34.000000000 -0400 +++ /var/www/html/redmine/app/views/settings/_general.rhtml 2008-05-15 09:48:04.000000000 -0400 @@ -26,6 +26,9 @@
<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB
++<%= text_field_tag 'settings[attachment_storage_path]', Setting.attachment_storage_path, :size => 60 %>
+
<%= text_field_tag 'settings[per_page_options]', Setting.per_page_options_array.join(', '), :size => 20 %>
<%= l(:text_comma_separated) %>