debug
This commit is contained in:
parent
399d7b559a
commit
4da8b4e5f6
|
@ -26,10 +26,11 @@ class TestController < ApplicationController
|
|||
folder = "#{Rails.root}/files"
|
||||
input_filename = files_path
|
||||
zipfile_name = "#{Rails.root}/tmp/archiveZip/archive_#{Time.now.to_i}.zip"
|
||||
|
||||
Rails.logger.info "================================================================================================================================================================================================================================================================================================================================================================================================#{zipfile_name}"
|
||||
Dir.mkdir(File.dirname(zipfile_name)) if File.exist?(File.dirname(zipfile_name))
|
||||
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
||||
input_filename.each do |filename|
|
||||
zipfile.add(filename.split('/').last, folder + '/' + filename)
|
||||
zipfile.add(File.basename(filename), folder + '/' + filename)
|
||||
end
|
||||
zipfile.get_output_stream("ReadMe"){ |os|
|
||||
os.write "Homeworks"
|
||||
|
|
Loading…
Reference in New Issue