I'm working in a node JS REST service. All the endpoints are almost done. I have created a simple web page where the user can introduce a .gpx file (xml) and with the module xml2json convert it into json format. I have tried the function using a local path and works, but my problem comes when I deploy the application into a web service, Javascript can not take the local file path to convert the file and store the JSON into the database. I don't know how to proceed. Should I upload the file into my server and after that take the server path and converse the file? ( I don´t need the file so should I delete after the conversion?) Could I converse the file without upload to the server? Help me please with some clues to proceed. Thank you all in advance!
Asked
Active
Viewed 519 times
0
-
2this helpful : http://stackoverflow.com/questions/1773550/convert-xml-to-json-and-back-using-javascript – kollein Jul 26 '16 at 09:30
-
The main problem right now is how to handle the conversion. Should I upload the file to the server and do it in the server side? or there is any posibility to take the path from the user and convert it directly in the client side and save the JSON in the database? – Bruno Jul 26 '16 at 09:40
-
1PHP: use file_get_content to get content of a file, then convert XML to JSON – kollein Jul 26 '16 at 09:43
-
http://stackoverflow.com/questions/12936907/letting-user-open-an-xml-file-on-client-and-parse-it-using-javascript here I could find some info related with my problem. – Bruno Jul 26 '16 at 10:05
-
1i get, now try with use AJAX to send to file.php then respond to DOM. finally convert it . this way you not have to save that – kollein Jul 26 '16 at 10:46
-
Thank you, I try that :) – Bruno Jul 26 '16 at 10:58