I am trying to write a process to create a page with a button for uploading a txt file, and then there is a js function behind that will process the imported data and store them into a database. (e.g. split the text in txt file and store the data as different fields in a table)
I am current trying to log the file content only. I added a js function at the field uploadTXT’s onListSelect.
function dataonSubmit(five, context, result) {
const TXTFileData = context.uploadTXT;
five.log(TXTFileData);
return five.success(result);
}
However, when I import a file, it shows “No field associated with document uploader found”.
May i know what is the correct method to let users import a file from frontend and then process the data in backend and store the processed data in tables?
You can refer to this thread here: How to Store Document like Pdf in five?. It will guide you on the correct method for importing documents into Five and reading files.
You can also check out this video that covers the same process:
I read the above solution and i think it is about storing documents in db?
May I ask is it possible to not save the imported file in a db table after import?
As the content of the imported file is actually the data i want to inserts into another table, and my goal is to import and process the txt file to create a csv file and store it inside the target table.
Thus actually i dont really need to store the file into the db.