Closed asif-ca closed 1 year ago
I think I cannot reproduce the issue you described because the demo does not trigger any error on my end when I try to add these files in a zip file. Can you give me more details about the error you're seeing?
Hi, Thanks for Confirmation!
Yes it worked correctly when I checked the demo in another PC, then realized I have about 2.5GB remaining space on c drive
(in which my chrome is installed) on the PC I was facing an issue ( alert of undefined shows and everything stops means the download zip button did not get active)
I cleared more memory and it worked fine!
I integrated this library in a web application to zip user selected files but I am afraid that if the user has low memory (as this is browser-based) they will face same problems?
is there any workaround for this?
I can record a video if you are unable to replicate it on low memory PC (just alert show of undefined
and operation stops)
Thanks
Interesting, I hadn't thought about this case and I didn't do any tests in these conditions. The demo is not really optimized to save memory. I think of 2 points in particular:
BlobWriter
class, cf. https://github.com/gildas-lormeau/zip.js/blob/0dd86b2848443a9f46e0e4fa89dbf0b003592757/demos/demo-create-file.js#L17Therefore, you should avoid using Promise.all
but rather iterate with a for ... of
and remove the option bufferedWrite: true
. Moreover, it would probably be better to use another class than BlobWriter
(e.g. Uint8ArrayWriter
) because nothing guarantees that the browser does not write the Blob on the disk.
I'm closing this issue because it's not a bug but it will be converted to a discussion.
If we select multiple files and if there is something wrong with some of the files ( Even all tested pdf files are correct but the library unable to read some of them) It throws an error and stops everything:
Please check all these files and test by dragging all files:
Added table of content (21).pdf Added table of content (20).pdf Added table of content (19).pdf Added table of content (18).pdf Added table of content (17).pdf Added table of content (16).pdf Added table of content (15).pdf Added table of content (14).pdf Added table of content (13).pdf Copmcri-locked (6).pdf