-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERR_FS_FILE_TOO_LARGE error for 2.07 GB (2,223,069,643 bytes) zip file #537
Comments
Did some more googling Apparently, given the official spec of zip files, it is not possible to stream? |
In case someone in the future has this same error: Ended up calling command line from within JavaScript to unzip file: tar -xf input_path -C output_path I had to ensure the output_path directory exists before unzipping to it https://askubuntu.com/questions/45349/how-to-extract-files-to-another-directory-using-tar-command https://superuser.com/questions/1314420/how-to-unzip-a-file-using-the-cmd |
officially ZIP does support streaming. ADM-ZIP has chosen to use buffer for temporary storage and it may be limiting factor. |
Thank you for the reply! I ended up writing my own function that calls tar from the command line:
|
Here is my code:
import AdmZip from "adm-zip";
let zip = new AdmZip(z_path);
zip.extractAllTo(output_path, false);
Google says:
According to this answer on GitHub, 2GB is the limit:
That is the max buffer size in node. To import larger files, the code will need to change the imports to streams instead of putting the whole file in a buffer (...).
Stack trace, excluding my function calls:
node:fs:418
throw new ERR_FS_FILE_TOO_LARGE(size);
^
RangeError [ERR_FS_FILE_TOO_LARGE]: File size (2223069643) is greater than 2 GiB
at tryCreateBuffer (node:fs:418:13)
at Object.readFileSync (node:fs:471:14)
at new module.exports (D:\dev\node_modules\adm-zip\adm-zip.js:60:37)
The text was updated successfully, but these errors were encountered: