So I had a thought today. I generate CSV from data already in memory in my JavaScript application, then pump that data to the user's browser via a File download prompt -- all in JavaScript --.
Is this possible?
So I had a thought today. I generate CSV from data already in memory in my JavaScript application, then pump that data to the user's browser via a File download prompt -- all in JavaScript --.
Is this possible?
If your server is setup to trigger a download for your given MIME type then you can simply do a straight location.href = 'myFile.csv'.
This will prompt the user to open or save the file as you'd like.
This does require that your server be configured to behave this way.
If you want to do it entirely on the client-side, without any server interaction, you will need at least the help of Flash.
Give a look to Downloadify, is the best I've seen for client-side file generation.
Check the demo.