Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how validate csv file only #37

Open
jayanty3 opened this issue Jul 23, 2020 · 8 comments
Open

how validate csv file only #37

jayanty3 opened this issue Jul 23, 2020 · 8 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@jayanty3
Copy link

No description provided.

@Bunlong
Copy link
Owner

Bunlong commented Jul 29, 2020

@jayanty3 I don't get your point. Could you pls give me more detail? Thanks!

@jacobedawson
Copy link

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.

@bobbyrinaldy
Copy link

bobbyrinaldy commented Oct 5, 2020

@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

@jacobedawson
Copy link

Thanks @bobbyrinaldy, much appreciated :)

@Bunlong Bunlong added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 21, 2020
@Bunlong Bunlong self-assigned this Oct 21, 2020
@exaucae
Copy link

exaucae commented Feb 4, 2021

Any progress so far?

@Bunlong
Copy link
Owner

Bunlong commented May 31, 2021

@exaucae Could you try bobbyrinaldy solution?

@exaucae
Copy link

exaucae commented May 31, 2021

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.

@alex-airbox
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants