Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client side processing and parsing of a csv file without it ever being uploaded to some server

I am trying to create a utility website that will parse csv files uploaded by clients. I want the processing to happen completely on the client side rather than having the file be uploaded to some server and then some server program parsing out the contents of the file. Is this possible? I'm a backend guy so any frontend advice would be helpful.

like image 360
Horse Voice Avatar asked Jan 16 '14 22:01

Horse Voice


1 Answers

If you are willing to restrict to supported browsers, you can use html 5 filereader API:

the main problem is ie < 10. http://caniuse.com/filereader

More info on File API:

  • browser load local file without upload

  • http://www.w3.org/TR/FileAPI/

once you access the file, parsing the csv with javascript is easy with existing libraries such as:

https://github.com/gkindel/CSV-JS

like image 163
CodeToad Avatar answered Sep 28 '22 19:09

CodeToad