summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-22 17:55:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-22 17:55:19 +0000
commit9b579de9e234e378fb5081d79bea02d175495db7 (patch)
tree28d55b59b2ade9201dd0ea518c56e740b039e649 /app/models/attachment.rb
parent8a7bfc72b20a0a554812db7f8bb7bfdf3e2a21d4 (diff)
downloadredmine-9b579de9e234e378fb5081d79bea02d175495db7.tar.gz
redmine-9b579de9e234e378fb5081d79bea02d175495db7.zip
Appends the filename to the attachment url so that clients that ignore content-disposition http header get the real filename (#1649).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1686 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r--app/models/attachment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 7d6a74ebb..8f3f530c7 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -26,7 +26,7 @@ class Attachment < ActiveRecord::Base
validates_length_of :disk_filename, :maximum => 255
acts_as_event :title => :filename,
- :url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}}
+ :url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id, :filename => o.filename}}
cattr_accessor :storage_path
@@storage_path = "#{RAILS_ROOT}/files"