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