Index: app/controllers/repositories_controller.rb =================================================================== --- app/controllers/repositories_controller.rb (revision 2821) +++ app/controllers/repositories_controller.rb (working copy) @@ -119,7 +119,14 @@ show_error_not_found and return unless @content if 'raw' == params[:format] || @content.is_binary_data? || (@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte) # Force the download - send_data @content, :filename => @path.split('/').last + fn = @path.split('/').last + type = Redmine::MimeType.of(fn) #Get the Mime-Type of the File + if type + send_data @content, :filename => fn, :type => type, :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")