##// END OF EJS Templates
Fix that AttachmentsController#show don't close the file after reading....
Jean-Philippe Lang -
r14907:3e1d2c09243b
parent child
Show More
@@ -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.new(@attachment.diskfile, "rb").read
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.new(@attachment.diskfile, "rb").read
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