Write / read csv file in Js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write / read csv file in Js

I have not very much experience with js but canyou tell me how to write, read and create csv files in js?

20th Aug 2018, 2:12 PM
Tim
Tim - avatar
3 Answers
+ 2
You cannot create, write or read csv file in JavaScript due to security concerns.
20th Aug 2018, 2:57 PM
Calviղ
Calviղ - avatar
+ 1
You must do this at backend side. You can send the data from client with ajax in json format to a webservice build in php (for example). In php you transform the data to csv format and force download the file. http://php.net/manual/en/function.fputcsv.php
20th Aug 2018, 6:12 PM
Zguillez
Zguillez - avatar
0
And what if we want to save the files at the client?
20th Aug 2018, 5:33 PM
Tim
Tim - avatar