jszip icon indicating copy to clipboard operation
jszip copied to clipboard

End of data - corrupted zip ?

Open frontBOI opened this issue 5 years ago • 4 comments

Hi everybody,

I am getting a compressed JSON file from a WebService and trying to decompress it using JSZip.

Compressed response

Here is the compressed response (which is a valid zip file, downloadable and extractable): PKz�<Q5416208540718863381.dat���j�0E����M�f$�F��R��&�Җ6ݗ�_9첮Ӌ�PZ�%_�<:�+����������y�ﻻ�c��.��?ޏÅ^��u��z����[���_]��:<�Ӳ����rhxZ�Z?�:}!�J�bQ}|V�xx;�oߏ�����>���ׯ���>��_����c�{��=^k��cw�x���Z�B�9�Ƭ�Tc�T-9O���@�U*MQE Ixߴ�FD�:�6� n�4� �ox��}Nq��<�+j�)b�"!f��J�S �;sf F�&J[� $9�&�@�l�� ���h����M$&D!���"�D�)�bQ�D^E��� D��*����+ƣ���^���m�bU�f�)bL2��bHRnaD*�V΃�F^�X]d��#��3W�"D�*kqq� FR��A 4��l0����o!s��+��9V��t�����B�+�U�A?h�W�:����ACX�5��~�$�0;����Q%��b��4₂�@�ĸC,f4������=���f,��׉&���������-��xs3}�1�p5�ڇ:7���Fv��1όt}͞뼊�k�����}�2����RepC>z� =��w�0� Ӽ%\*��B1z�؆X�eKu�m�#=bl{l8� +cfQL�m�Re�l�Ȟ��9bnv�g�W�� c[Yyft�*z�����t�G����yK���n�0F��l��ĻN��w�p�:��x���ŻN� �u2����a�:�y��9�PK�M \��(PKz�<Q�M \��(5416208540718863381.datPKE<

Decompression code

And here is my code to decompress it (content contains the compressed text I posted before): `

  async decodeZIPFile (content) {
        return new Promise((resolve, reject) => {
          const JSZip = require('jszip')
          const zip = new JSZip()

          zip.loadAsync(content).then(unzipped => {
            resolve(unzipped)
          })
        })
      },

`

My problem

Unfortunately, this gives me the following error: Uncaught (in promise) Error: End of data reached (data length = 818, asked index = 819). Corrupted zip ?

What did I do wrong ?

frontBOI avatar Sep 28 '20 15:09 frontBOI

same problem? Did you solved?

jawn-ha avatar May 23 '22 09:05 jawn-ha

Same problem, did anyone find a solution?

ADCrouch avatar Sep 28 '23 06:09 ADCrouch