Feature #2209 » dl_repo_files_with_MimeType_r2823.patch
| app/controllers/repositories_controller.rb (working copy) | ||
|---|---|---|
|
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")
|
||
- « Previous
- 1
- 2
- 3
- Next »