Open tyilo opened 13 years ago
This is a pretty good idea, as I can see how zipping canvas/pngs will get bigger than 2mb. If I get some spare time I'll look into implementing this
Note to self: see section K of http://www.pkware.com/documents/casestudies/APPNOTE.TXT for implementation details
Was there a solution to this?
I am facing the same issue. I have file zipped that I need to set for downloading. I am using the following code: document.getElementById(elementId).href = "data:application/zip;base64,"+content; where content is the zipped file. Since the file size is more than 2 MB, the tab crashes. Is there an alternative way to do this?
@RajeshShah I will answer on your stackoverflow post.
Solution is to use URL.createObjectURL(blob)
or StreamSaver.js
base64 is the worst
And I wouldn't want to prompt the users with more then 1 save dialog. So this is to me a bad idea but still necessary if you using a FAT32 where the filesize can not be larger then 4gb
The current URL lenght limit in chrome is 2097152 characters. So if you create a larger zip-file than that and try to download it, the chrome tab will crash. However if you would be able to split the zip into multiple parts with a maximum character size of (2097152 - 28 (length of "data:application/zip;base64,") you could download all the parts using window.open