I would like to allow customers to upload a file with records (say .csv or excel) and then that file to be parsed and its content to be transferred into Wix database.
Can you please advise if it is possible via simple means ?
My idea so far is to upload the file into Media Manager , get its URL , then use NPM module to access the content of the file (say csv-parse) , stringify it to JSON and store it into Wix Databse - this sounds complicated to me but will it work as a concept ?
Would appreciate any answers and opinions on the topic !
Hi,
This will work if you manage to convert .csv file to JSON object. After that, you can follow the instructions here to insert it into a database.
When uploading the file, you can pass it to an online tool, such as convertcsv.com , to convert your CSV data to the JSON format using http functions.
Then get the JSON file using fetch API.
Aleks, Thank you for your suggestion !
I though about this, but it will be too slow. In general my interest is if it is possible to access and work on user uploaded data (file) - just pass it to a function and process it - do you know if it will work and how ?
Regards,
Vasil
Hello @aleksf , can you please elaborate on your suggestion "…When uploading the file, you can pass it to an online tool, such as convertcsv.com… " - how can I get uploaded file and send it to an online tool ?
Will appreciate very much your help !
Regards,
Vasil