Index: app/controllers/repositories_controller.rb
===================================================================
--- app/controllers/repositories_controller.rb	(revision 2043)
+++ app/controllers/repositories_controller.rb	(working copy)
@@ -17,6 +17,7 @@
 
 require 'SVG/Graph/Bar'
 require 'SVG/Graph/BarHorizontal'
+require 'redmine/mime_type'
 require 'digest/sha1'
 
 class ChangesetNotFound < Exception; end
@@ -118,7 +119,13 @@
     show_error_not_found and return unless @content
     if 'raw' == params[:format] || @content.is_binary_data?
       # Force the download if it's a binary file
-      send_data @content, :filename => @path.split('/').last
+      fn = @path.split('/').last
+      type = Redmine::MimeType.of(fn)
+      if type
+        send_data @content, :filename => fn, :type => Redmine::MimeType.of(fn), :disposition => 'inline'
+      else
+        send_data @content, :filename => fn
+      end
     else
       # Prevent empty lines when displaying a file with Windows style eol
       @content.gsub!("\r\n", "\n")
