I have seen a number of questions that talk about getting data into HTML5 local storage and even seen a cool text editor that saves the files in local storage. I have a similar application and would like to now be able to let a user take a file they have been editing in local storage and then save it on their desktop.
I can stream the file up to a service on the server and get the browser to prompt that way but I was hoping to keep it all client side. The files are typically going to be text or xml based. Is there a way to setup a service in angular to take the bytes of the file in local storage then stream that and make the browser prompt the user for the save location etc.
Any help keeping it client side would be greatly appreciated.
Rich
You don't need to upload the file to a server and let the user donwload it - it makes no sense. What if the server shouldn't be allowed to access this file?
Anyway, I use the FileSaver.js library in my angularJS projects and it works just fine.
You can serve several files in a file archive with libraries such as JSZip.
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