Creating and saving file in Javascript | Sololearn: Learn to code for FREE!


Creating and saving file in Javascript

How can a create and save a file(e.g txt) into the web users pc

6/6/2018 2:27:35 PM


3 Answers

New Answer


steve You cant directly save it with javascript but you can force the user to download it. To create file you should take a look at ”Blob” thingy Would be easier with server side.


Browsers do not allow web scripts like JavaScript to store any files into local pc due to security reasons. You can only use local storage functions to store script variables in local pc.


inspite of that how i create the file...maybe i ll just upload it to the sever