Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jszip create zip file

var zip = new JSZip();

// Add a text file with the contents "Hello World
"
zip.file("Hello.txt", "Hello World
");

// Add a another text file with the contents "Goodbye, cruel world
"
zip.file("Goodbye.txt", "Goodbye, cruel world
");

// Add a folder named "images"
var img = zip.folder("images");

// Add a file named "smile.gif" to that folder, from some Base64 data
img.file("smile.gif", imgData, {base64: true});

zip.generateAsync({type:"base64"}).then(function (content) {
     location.href="data:application/zip;base64," + content;
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript to change value on screen with radio button 
Javascript :: count object in array javascript 
Javascript :: static variable in javascript 
Javascript :: how to dynamic title in nuxt 
Javascript :: javascript input 
Javascript :: Svg as a component react 
Javascript :: js bitwise operators 
Javascript :: javascript check if string contains only numbers 
Javascript :: javascript promise 
Javascript :: javascript get fibonacci number 
Javascript :: bootstrap react 
Javascript :: javascript NEGATIVE_INFINITY 
Javascript :: js combine 2 array to object key value 
Javascript :: javascript range between two numbers 
Javascript :: how to convert string into binary in javascript 
Javascript :: how to concat nested array in javascript 
Javascript :: delete document mongoose 
Javascript :: javascript lowest number 
Javascript :: js array map 
Javascript :: javascript allow default 
Javascript :: jquery disable all forms 
Javascript :: can we call ajax inside ajax success 
Javascript :: Select radio button through JQuery 
Javascript :: slide hide animaition in react 
Javascript :: javascript function from string 
Javascript :: How to create sequelize connection in javascript 
Javascript :: odd even javascript 
Javascript :: what is side effect 
Javascript :: Square Every Digit 
Javascript :: javascript ES6 Default Parameter Values 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =