Fixed: No mime-types in documents/files downloading

git-svn-id: http://redmine.rubyforge.org/svn/trunk@898 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-11-12 15:13:42 +00:00
parent 8a8f819d27
commit 843d04f0e3
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class DocumentsController < ApplicationController
def download def download
@attachment = @document.attachments.find(params[:attachment_id]) @attachment = @document.attachments.find(params[:attachment_id])
@attachment.increment_download @attachment.increment_download
send_file @attachment.diskfile, :filename => @attachment.filename send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type
rescue rescue
render_404 render_404
end end

View File

@ -39,7 +39,7 @@ class VersionsController < ApplicationController
def download def download
@attachment = @version.attachments.find(params[:attachment_id]) @attachment = @version.attachments.find(params[:attachment_id])
@attachment.increment_download @attachment.increment_download
send_file @attachment.diskfile, :filename => @attachment.filename send_file @attachment.diskfile, :filename => @attachment.filename, :type => @attachment.content_type
rescue rescue
render_404 render_404
end end