0

I have been using RawDeflate in my javascript code to unzip files. Recently I found that it was silently failing sometimes, and I traced it down to the case when the original file was over 2G. I tried switching to pako but that is also failing (at least not silently). Does anyone know of any JS package that can unzip files larger then 2G?

This is what I get in my browser console:

pako.min.js:1 Uncaught invalid stored block lengths
n @ pako.min.js:1
a.inflateRaw @ pako.min.js:1
success @ ui.js:1122
l @ jquery-1.8.3.min.js:2
fireWith @ jquery-1.8.3.min.js:2
T @ jquery-1.8.3.min.js:2
r @ jquery-1.8.3.min.js:2
Larry Martell
  • 3,526
  • 6
  • 40
  • 76
  • Why are you unzipping in-browser? If you need to send compressed files to the client, I think gzip works just fine. – posit labs Dec 14 '17 at 18:38
  • I don't know if I understand your question. The file has data that will be plotted in the browser. The data is 2.5G but zipped it's 5M. I am zipping in python before sending and JS code needs to unzip to plot it. – Larry Martell Dec 14 '17 at 18:47
  • You can't ask for recommendations for libraries or tools here, as clearly said in the [help/on-topic] guidelines: * Questions asking us to **recommend or find a book, tool, software library, tutorial or other off-site resource** are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. * – Ken White Dec 14 '17 at 18:58
  • Browsers support gzip compression, which basically means that clients can accept gzipped files. They are automatically unzipped upon arrival. If you enable gzipping on your server, I don't think you will need to zip anything manually before sending, or unzip manually on the client. – posit labs Dec 15 '17 at 01:57
  • I am unclear on your use of the term 'client' here. The browser is the client. The server is doing the compression and the browser has to do the unzipping so it can use the data. – Larry Martell Dec 15 '17 at 02:32
  • Yes. I'm saying you should enable gzip on your server so the client doesn't have to explicitly unzip anything. gzip decompression happens automatically. – posit labs Dec 15 '17 at 06:38
  • Perhaps you are under the impression that I am downloading a zipped file to the user's computer. That is not the case. Here is my use case:The user clicks a button in their browser and that sends an ajax request to my server. The python code that receives that request generates a zipped response and sends it back to the browser (i.e. the client). The browser needs to unzip that so it can get at the data inside which it will use to generate and display a chart. I do not see how your comments apply to my situation. If indeed you do have a workable solution, please post the details as an answer. – Larry Martell Dec 15 '17 at 14:08

0 Answers0