Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


JSZip with Blob unexpected behaviour #23

pbhd opened this Issue · 6 comments

3 participants


Thats not an error, but when trying to use the results of generate it took me a while to figure out what's wrong. See, read the comments to the accepted answer. So from that, I think it would be a good idea to be able to make generate return an Uint8Array on request. But more important would be to add a hint to the documentation about using Blob's (Maybe I missed it? Sorry then) But nevertheless, JSZip is a great thingy, thanks for it.


Good idea. If JSZip can use the File API (when reading or writing), it will be easier and more straightforward to use in some use cases.
I have started working on it.


This is on my branch issue23. This should solve the stackoverflow issue with a

sendFile("", zip.generate({responseType:"blob"}));

I still need to be sure I didn't break older browsers (I will be able to test IE 6-9 the next week).
@Stuk : could you check the updated documentation ? I would like to be sure you're ok with the responseType parameter and the new examples.


The extra option looks good, but I think just type would be a better name, as there is no response :)

Do you think it would be a good idea to deprecate the base64 option in lieu of type: "base64" to keep things simple?

Finally, could you add the other possible values (uint8array, arraybuffer ) to the jsdoc?


You're right, type is better. I spent to much time playing with the ajax's responseType :)

I think that deprecating base64 is a good idea : generate({type:"string"}) doesn't clearly show what the output will be (but will confuse the reader) and generate({type:"arraybuffer", base64:true}) doesn't make any sense.

My branch issue23 should be ready this week-end !

@dduponchel dduponchel referenced this issue from a commit in dduponchel/jszip
@dduponchel dduponchel issue #23 feedback
* use type instead of responseType
* deprecate generate({base64:true})
* improve documentation

JSZip now generates Blobs / ArrayBuffers / Uint8Array, check the documentation. Thanks for the bug report :)

@dduponchel dduponchel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.