Currently I have a string that I want to save as a text file to the machine running my webpage. How do I open a Save As Dialog so the user can identify which directory the file should be saved to?
Asked
Active
Viewed 343 times
1
-
1What do you mean, you have a string? Is it in any input element? – KayD Oct 14 '20 at 22:06
-
1@KayD I call data from my webpage and store it in a string. I then want to save that string into a text file. I want the user to use the Save As Dialog so that they can specify where the file should be saved to. – Oct 14 '20 at 22:09
-
1seems possible answered here https://stackoverflow.com/questions/3665115/how-to-create-a-file-in-memory-for-user-to-download-but-not-through-server – KayD Oct 14 '20 at 22:12
-
1I don't think this is possible. A user may upload their own files or specify upload paths from their own system, but browser Javascript isn't allowed to manipulate a user's file system. That'd be a security issue! – Hello World Oct 14 '20 at 22:14
-
1So is the only way for a user to download a file to their download directory? – Oct 14 '20 at 22:21
-
1yes default directory is only solution. detail explanation can be found [here](https://stackoverflow.com/questions/42968742/save-as-dialog-box-when-downloading-a-file-on-web-browser) – sandeep joshi Oct 15 '20 at 04:36