how validate csv file only
@jayanty3 I don't get your point. Could you pls give me more detail? Thanks!
I think what @jayanty3 is asking is: is there a way to ensure that users only upload .csv files. I would also like to know this - we don't seem to have access to the file extension in order to ignore any non-csv files.
@jacobedawson you can use File Type while you using onFileLoaded function and just give it validation like usual.
for example :
onFileLoaded={(data, fileInfo) => console.log(data, fileInfo)} //File info has some filename or type that you can use
Thanks @bobbyrinaldy, much appreciated :)
Any progress so far?
@exaucae Could you try bobbyrinaldy solution?
Yes, I did. It means we have to enforce file type by writing custom logic. It would have been nice to have it built in.
Is this still valid? Issue is open but comment is from 3 years ago. And I can't find that onFileLoaded on the onFileLoaded definition, just onUploadAccepted and onUploadRejected.
And I noticed there's reference to a accept property with a sidenote on the docs about it, so maybe this should be closed as it's built in.