madas
madas

Reputation: 73

create zip file and save it in a particular location using javascript

I am using jszip to create a zip file using javascript.And I want to zip a folder. I am using the following sample code to create zip file

var zip = new JSZip();
zip.file("Hello.txt", "Hello World\n");
var img = zip.folder("images");
img.file("smile.gif", imgData, {base64: true});
var content = zip.generate();
location.href="data:application/zip;base64,"+content;

Using the above code the download popup is coming. But I want to save that zip file in a particular location without browse. How I can implement that. Thanks in advance for answer

Upvotes: 0

Views: 2736

Answers (2)

Khan Hafizur Rahman
Khan Hafizur Rahman

Reputation: 105

Just for the information, zip.generate() has been removed in jsZip 3.0

Upvotes: 1

commit
commit

Reputation: 4807

You can not save zip or any other file at particular position using javascript or other scripts without browser, it's security violation, so as per my knowledge you can not do that at list by javascript.

Upvotes: 0

Related Questions