Added filename header when sending an image inline

git-svn-id: http://redmine.rubyforge.org/svn/trunk@550 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-05-27 18:45:48 +00:00
parent 413247ee5b
commit 4cf1b68969
1 changed files with 1 additions and 1 deletions

View 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