]> source.dussan.org Git - redmine.git/commitdiff
Added filename header when sending an image inline
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 27 May 2007 18:45:48 +0000 (18:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 27 May 2007 18:45:48 +0000 (18:45 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@550 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/attachments_controller.rb

index e0a02d8e8018107c34d44ead40fa31a1fa879581..3ddb052dd8d563f09b5a610eaea18f2295e0a884 100644 (file)
@@ -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