summaryrefslogtreecommitdiffstats
path: root/app/controllers/attachments_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-27 18:45:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-05-27 18:45:48 +0000
commit4cf1b6896938ec30106d187f0571058503fc853e (patch)
treefefe00e67f6b39b4f44c9dc893f73606d4758fa6 /app/controllers/attachments_controller.rb
parent413247ee5b1643dff7923687711c77a5d90d41f5 (diff)
downloadredmine-4cf1b6896938ec30106d187f0571058503fc853e.tar.gz
redmine-4cf1b6896938ec30106d187f0571058503fc853e.zip
Added filename header when sending an image inline
git-svn-id: http://redmine.rubyforge.org/svn/trunk@550 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/attachments_controller.rb')
-rw-r--r--app/controllers/attachments_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index e0a02d8e8..3ddb052dd 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -29,7 +29,7 @@ class AttachmentsController < ApplicationController
# sends an image to be displayed inline
def show
render(:nothing => true, :status => 404) and return unless @attachment.diskfile =~ /\.(jpeg|jpg|gif|png)$/i
- send_file @attachment.diskfile, :type => "image/#{$1}", :disposition => 'inline'
+ send_file @attachment.diskfile, :filename => @attachment.filename, :type => "image/#{$1}", :disposition => 'inline'
rescue
render_404
end