I am using NextJs with Typescript.
Could you confirm the object type returned in event.files?
Could you also let me know the type of the onUpload event parameter?
I am looking to read the contents.
Code: Select all
<FileUpload
name="edcStock"
url="http://localhost:3000/secure/admin/upload-edc"
onUpload={onUpload}
accept="text/xml"
maxFileSize={1000000}
/>
[const onUpload = async (event: any) => {
console.log(event.files);
const files = event.files;
console.log(typeof files[0]);
toast.current?.show({
severity: 'info',
summary: 'Uploaded',
detail: 'EDC stock file uploaded',
life: 3000,
});
};
/code]
Many thanks