Using jQuery/javascript I am making a personal program for me and my friends to use. I wanted to have a functionality that downloads a file from an external (online) url and then save it to a particular directory relative to my /root folder.
I cannot use this on a server as I just want to run the html file locally - however it may be hosted online in the future.
I'm not worried about security at this current point in time - so is this possible to do?
Using jQuery/javascript I am making a personal program for me and my friends to use. I wanted to have a functionality that downloads a file from an external (online) url and then save it to a particular directory relative to my /root folder.
I cannot use this on a server as I just want to run the html file locally - however it may be hosted online in the future.
I'm not worried about security at this current point in time - so is this possible to do?
Share Improve this question asked Apr 2, 2015 at 22:52 ChiMoChiMo 6012 gold badges15 silver badges34 bronze badges 1- 1 No. JavaScript cannot save files locally. It doesn't matter if you aren't worried about security--the browser still is. – Dave Commented Apr 2, 2015 at 23:01
1 Answer
Reset to default 2In Javascript you cannot directly save a file to your root folder or choose the location of where the file is saved. However with Javascript you can cause the browser to prompt the user to save the file locally. Take a look at this github project:
https://github./eligrey/FileSaver.js