0

"A string to string JSZip decoding" (Alternate title)

I recently got in a situation in which I needed to fetch a text data from a remote resource which serves it in zip file format only, and render it. I found out there's a thing named JSZip, but couldn't locate the integral part which deals with the actual decoding.

Let's say, my variable contains a string like this: "PKVP=HBBThe.Autopsy.of.Jane.Doe.2016.720p.BluRay.x264.[YTS.MX]-English.srtUT h^h^ux}]ܶC?\o[YzO3_sA7@oT_?nyzS\?q?_~U6:W&lm޽~>~(fF7-E<ַ02snSյoz׽~b_n\)8Ňy=K^^]<4M K</f{..."

As you can see the content of the string is a Zip compressed subtitle. Any help will be much appreciated.

Bekim Bacaj
  • 5,707
  • 2
  • 24
  • 26
  • Does this answer your question? [Decompress gzip and zlib string in javascript](https://stackoverflow.com/questions/14620769/decompress-gzip-and-zlib-string-in-javascript) – showdev Mar 13 '21 at 02:13
  • @showdev I don't think it does. My question is about a normal .zip file. – Bekim Bacaj Mar 13 '21 at 02:31
  • Ok, sorry. I thought you were referring to a string. – showdev Mar 13 '21 at 02:32
  • You should be able to use JSZip's [`loadAsync()`](https://stuk.github.io/jszip/documentation/api_jszip/load_async.html) function. – Ouroborus Mar 13 '21 at 02:54

0 Answers0