From 4cf1b6896938ec30106d187f0571058503fc853e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 27 May 2007 18:45:48 +0000 Subject: [PATCH] Added filename header when sending an image inline git-svn-id: http://redmine.rubyforge.org/svn/trunk@550 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/attachments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index e0a02d8e..3ddb052d 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 -- 2.11.0