Skip to content
Advertisement

Zipfile: How to download a zipfile and save without extract?

I would like to download a zipfile from url and save somewhere. I don’t want to extract my file and that is my problem. I have a code which download zipfile and extract files, but I want to only download and save. What should I change?

JavaScript

Advertisement

Answer

Just don’t use ZipFile at all. You have the file content, write it out:

JavaScript

To read and save in chunks, in case you have small RAM:

JavaScript

This reads 1024 bytes every iteration, you should change it accordingly to your need.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement