@@ -28,7 +28,7 class AttachmentsController < ApplicationController | |||||
28 | respond_to do |format| |
|
28 | respond_to do |format| | |
29 | format.html { |
|
29 | format.html { | |
30 | if @attachment.is_diff? |
|
30 | if @attachment.is_diff? | |
31 |
@diff = File. |
|
31 | @diff = File.read(@attachment.diskfile, :mode => "rb") | |
32 | @diff_type = params[:type] || User.current.pref[:diff_type] || 'inline' |
|
32 | @diff_type = params[:type] || User.current.pref[:diff_type] || 'inline' | |
33 | @diff_type = 'inline' unless %w(inline sbs).include?(@diff_type) |
|
33 | @diff_type = 'inline' unless %w(inline sbs).include?(@diff_type) | |
34 | # Save diff type as user preference |
|
34 | # Save diff type as user preference | |
@@ -38,7 +38,7 class AttachmentsController < ApplicationController | |||||
38 | end |
|
38 | end | |
39 | render :action => 'diff' |
|
39 | render :action => 'diff' | |
40 | elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte |
|
40 | elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte | |
41 |
@content = File. |
|
41 | @content = File.read(@attachment.diskfile, :mode => "rb") | |
42 | render :action => 'file' |
|
42 | render :action => 'file' | |
43 | else |
|
43 | else | |
44 | download |
|
44 | download |
General Comments 0
You need to be logged in to leave comments.
Login now