user3116539
user3116539

Reputation: 49

Download file direct to specific location using javascript

I am using jsPDF to generate PDF file. What I want to do is when I click save button to save the file to specific location, for example in Desktop.

So far my code does this:

var doc = new jsPDF();
doc.addImage(imgData, 'JPEG', 0, 0, 210, 40);
doc.save('test.pdf');

The .save function just gives us the opportunity to download the file, but what I want is to save the file to specific location, for example C:\Users\username\Desktop.

Thank you.

Upvotes: 2

Views: 5088

Answers (1)

Marco Bonelli
Marco Bonelli

Reputation: 69276

You can't do that: JavaScript has no access to filesystem.

Upvotes: 2

Related Questions