]> source.dussan.org Git - redmine.git/commitdiff
Fixed: No mime-types in documents/files downloading
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 12 Nov 2007 15:13:42 +0000 (15:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 12 Nov 2007 15:13:42 +0000 (15:13 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@898 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/documents_controller.rb
app/controllers/versions_controller.rb

index 442a6a288870f06092446e6933af5e8b9e3e2914..63ee961343b5da0fc138870c28b2f29c4e38edbf 100644 (file)
@@ -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 
index f19dcda9c4f01cdbdd495716a8126cb2757c88ae..4e9016ebf71224867b53394b96223f51ee5b0b0a 100644 (file)
@@ -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