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:
parent
413247ee5b
commit
4cf1b68969
|
@ -29,7 +29,7 @@ class AttachmentsController < ApplicationController
|
||||||
# sends an image to be displayed inline
|
# sends an image to be displayed inline
|
||||||
def show
|
def show
|
||||||
render(:nothing => true, :status => 404) and return unless @attachment.diskfile =~ /\.(jpeg|jpg|gif|png)$/i
|
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
|
rescue
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue