##// END OF EJS Templates
Added filename header when sending an image inline...
Jean-Philippe Lang -
r547:4cf1b6896938
parent child
Show More
@@ -29,7 +29,7 class AttachmentsController < ApplicationController
29 # sends an image to be displayed inline
29 # sends an image to be displayed inline
30 def show
30 def show
31 render(:nothing => true, :status => 404) and return unless @attachment.diskfile =~ /\.(jpeg|jpg|gif|png)$/i
31 render(:nothing => true, :status => 404) and return unless @attachment.diskfile =~ /\.(jpeg|jpg|gif|png)$/i
32 send_file @attachment.diskfile, :type => "image/#{$1}", :disposition => 'inline'
32 send_file @attachment.diskfile, :filename => @attachment.filename, :type => "image/#{$1}", :disposition => 'inline'
33 rescue
33 rescue
34 render_404
34 render_404
35 end
35 end
General Comments 0
You need to be logged in to leave comments. Login now