diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 442a6a28..63ee9613 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -39,7 +39,7 @@ class DocumentsController < ApplicationController def download @attachment = @document.attachments.find(params[:attachment_id]) @attachment.increment_download - send_file @attachment.diskfile, :filename => @attachment.filename + send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type rescue render_404 end diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index f19dcda9..4e9016eb 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -39,7 +39,7 @@ class VersionsController < ApplicationController def download @attachment = @version.attachments.find(params[:attachment_id]) @attachment.increment_download - send_file @attachment.diskfile, :filename => @attachment.filename + send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type rescue render_404 end