diff --git a/examples/download-zip-file.html b/examples/download-zip-file.html index 93cd4b31..1d68ca2e 100644 --- a/examples/download-zip-file.html +++ b/examples/download-zip-file.html @@ -14,10 +14,12 @@
Tip : check the source of the page !
With some recent browsers come a new way to download Blobs (a zip file for example) : blob urls. The download attribute on <a> allows you to give the name of the file. Blob urls start to be widely supported but this attribute is currently only supported in Chrome and Firefox (>= 20). See the example.
+With some recent browsers come a new way to download Blobs (a zip file for example) : blob urls. The download attribute on <a> allows you to give the name of the file. Blob urls start to be widely supported but this attribute is currently only supported in Chrome and Firefox (>= 20). See the example. Note : on IE 10/11, using a blob url as a href doesn't seem to work.
var blob = zip.generate({type:"blob"}); myLink.href = window.URL.createObjectURL(blob); myLink.download = "myFile.zip";+
An other solution is the FileSaver interface, created (at the time of writing) with saveAs
. This works on Chrome and IE >= 10 (not in compatibility view) but not Firefox.
+var blob = zip.generate({type:"blob"}); +window.saveAs(blob, "hello.zip");+ +
Finally, you can use the polyfill FileSaver.js which will use a FileSaver if present or else a blob url.
+Franz Buchinger has written a brilliant tutorial on using JSZip with Google Gears (part 2). If you want to let your Gears users download several files at once I really recommend having a look at some of his examples.
@@ -245,15 +252,19 @@+var zip = new JSZip(); +// same as +var zip = JSZip();-
load()
for more details and this for the limitations.new JSZip(zipDataFromXHR, {base64:false}); // same as +JSZip(zipDataFromXHR, {base64:false}); +// same as var zip = new JSZip(); zip.load(zipDataFromXHR, {base64:false});@@ -624,10 +637,14 @@
// before zip.file("test.txt").data; zip.files["test.txt"].data; +zip.file("image.png").data; +zip.files["image.png"].data; // after zip.file("test.txt").asText(); zip.files["test.txt"].asText(); +zip.file("image.png").asBinary(); +zip.files["image.png"].asBinary();