jszip doesn't work in OS X safari 9.1
I tested jszip in osx safari 9.1.
but It doesn't work.
the console error message is "Failed to load resource: frame load interrupted"
please check this issue
thank you
Could you provide a code snippet of what triggers the issue ?
var zip = new JSZip(); zip.file("Hello.txt", "Hello World\n"); var img = zip.folder("images"); img.file("smile.gif", imgData, {base64: true}); zip.generateAsync({type:"blob"}) .then(function(content) { // see FileSaver.js saveAs(content, "example.zip"); }); I tested for this source in this site(http://stuk.github.io/jszip). When I click RUN (in osx safari 9.1). It's not working with this message "Failed to load resource: frame load interrupted"
I think it is linked to eligrey/FileSaver.js/issues/12. Could you try
var zip = new JSZip();
zip.file("Hello.txt", "Hello World\n");
zip.generateAsync({type:"blob"})
.then(function(content) {
try {
saveAs(content, "example.zip");
} catch (e) {
alert("saveAs failed with " + e);
}
}).catch(function (e) {
alert("JSZip failed with " + e);
});
?
Same error here. Code snippet didn't work.
I tried that but It didn't work. I think blob type is not working at Safari.
I reckon it has something to do with the fact that the File constructor is not supported in Safari - CanIUse
@Stuk
If there is a way to set the type of the Blob in generateAsync to "application/octet-stream", that might solve the problem partially. Safari would commence the download but with the name of unknown and without any extension.
If there is a way to set the type of the Blob in generateAsync to "application/octet-stream"
It's the mimeType option:
zip.generateAsync({
type: "blob",
mimeType: "application/octet-stream"
})
Did you get this to work on iPad? Thanks