@@ -29,7 +29,7 class AttachmentsController < ApplicationController | |||
|
29 | 29 | # sends an image to be displayed inline |
|
30 | 30 | def show |
|
31 | 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 | 33 | rescue |
|
34 | 34 | render_404 |
|
35 | 35 | end |
General Comments 0
You need to be logged in to leave comments.
Login now