commit
c883fdd8f4
@ -378,9 +378,10 @@ class DmsfController < ApplicationController
|
||||
zipped_content = DmsfHelper.temp_dir.join(DmsfHelper.temp_filename('dmsf_email_sent_documents.zip'))
|
||||
|
||||
File.open(zipped_content, 'wb') do |f|
|
||||
zip_file = File.open(zip.finish, 'rb')
|
||||
while (buffer = zip_file.read(8192))
|
||||
f.write(buffer)
|
||||
File.open(zip.finish, 'rb') do |zip_file|
|
||||
while (buffer = zip_file.read(8192))
|
||||
f.write(buffer)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -78,11 +78,11 @@
|
||||
<% end %>
|
||||
<% testfilename = DmsfFile.storage_path.join('test.test') %>
|
||||
<% if File.exist?(storage_dir) %>
|
||||
<% begin %>
|
||||
<% File.open(testfilename, 'wb') %>
|
||||
<% begin %>
|
||||
<% File.open(testfilename, 'wb') {} %>
|
||||
<% rescue %>
|
||||
<p class="warning"><%= l(:error_file_can_not_be_created) %></p>
|
||||
<% ensure %>
|
||||
<% ensure %>
|
||||
<% FileUtils.rm_f(testfilename) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@ -108,12 +108,12 @@
|
||||
<% path = Pathname.new(tmpdir) %>
|
||||
<% testfilename = path.join('test.test') %>
|
||||
<% if File.exist?(tmpdir) %>
|
||||
<% begin %>
|
||||
<% File.open(testfilename, 'wb') %>
|
||||
<% begin %>
|
||||
<% File.open(testfilename, 'wb') {} %>
|
||||
<% rescue %>
|
||||
<p class="warning"><%= l(:error_tmpfile_can_not_be_created) %></p>
|
||||
<% ensure %>
|
||||
<% File.delete(testfilename) if File.exist?(testfilename) %>
|
||||
<% ensure %>
|
||||
<% FileUtils.rm_f(testfilename) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user