From 843d04f0e3fa0f841dd4db68262a130714443a0a Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang <jp_lang@yahoo.fr>
Date: Mon, 12 Nov 2007 15:13:42 +0000
Subject: [PATCH] Fixed: No mime-types in documents/files downloading

git-svn-id: http://redmine.rubyforge.org/svn/trunk@898 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
 app/controllers/documents_controller.rb | 2 +-
 app/controllers/versions_controller.rb  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb
index 442a6a288..63ee96134 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 f19dcda9c..4e9016ebf 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 
-- 
GitLab