Is it possible to generate a file in javascript and then prompt the user to download ?
What we would really like to do is the following : we want to make a small html form where an user can edit values in a table, and we would like to be able to generate a csv file from the form and prompt the user to save it on his hard drive. Is it possible in pure javascript ? If not, are there any workarounds ?
Note : I know I could solve this by a round-trip to a server, sending the form and getting a csv file back, but the trick here is that there is no server, the html form will just be generated on a hard drive.
Without a server to download from, you cant get them to download the data like normal.
You could output the csv data to a new browser window and the user could then save this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With