Commit 4cf1b689 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Added filename header when sending an image inline

git-svn-id: http://redmine.rubyforge.org/svn/trunk@550 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 413247ee
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment