diff options
Diffstat (limited to 'app/controllers/documents_controller.rb')
-rw-r--r-- | app/controllers/documents_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index b37a8371a..93f25c495 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -67,7 +67,8 @@ class DocumentsController < ApplicationController def download @attachment = @document.attachments.find(params[:attachment_id]) @attachment.increment_download - send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type + send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename), + :type => @attachment.content_type rescue render_404 end |