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