You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with Rails 5.0.1 and rubyzip 1.2.1. I'm working on a project where the user will be uploading large zip files and i'm using paperclip for uploading. After the files are uploaded to the server, they are being unzipped and saved.
Note: The error occurred for file created in windows using the default "Right click -> Send -> Compressed Folder". Also, the uploaded file is very large.
Following is my code for unzipping the files:
path = "path is generated dynamically"
zip_path = "path of the zip"
FileUtils.mkdir_p(path)
Zip::File.open(zip_path) do |zip_file|
zip_file.each do |f|
fpath = File.join(destination, f.name.gsub(" ","_")) #Replacing the spaces with hyphens
zip_file.extract(f, fpath) unless File.exist?(fpath)
end
end
So far i know this is related to the Deflate64 algorithm used by windows but that's it.
Sorry to come back to this after so long - maybe this answer will still be of some use.
The issue with Deflate64 is that it is a proprietary/closed format owned by PKWare and, as far as I know, there is no ruby implementation. If there is one that you know of please let me know, or you could implement it as an extension for rubyzip, like the bzip2 one: https://github.com/rubyzip/rubyzip-bzip2
Hello,
I'm working with Rails 5.0.1 and rubyzip 1.2.1. I'm working on a project where the user will be uploading large zip files and i'm using paperclip for uploading. After the files are uploaded to the server, they are being unzipped and saved.
Note: The error occurred for file created in windows using the default "Right click -> Send -> Compressed Folder". Also, the uploaded file is very large.
Following is my code for unzipping the files:
So far i know this is related to the
Deflate64
algorithm used by windows but that's it.I have referred the following links:
though, i'm yet unsure of the solution here. Is there a workaround to unzip this file?
Please guide me as to what can be done here. Thanks.
The text was updated successfully, but these errors were encountered: