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

Accept custom extensions like html file input #32

Open
larissa-n opened this issue Sep 4, 2019 · 0 comments
Open

Accept custom extensions like html file input #32

larissa-n opened this issue Sep 4, 2019 · 0 comments

Comments

@larissa-n
Copy link

In <input type='file'>, the fact that you can use the accept prop for random extensions (like accept='myext') is rather handy for all those that create and use proprietary file types.

Getting into react-dropzone, is it true that this example by @export-mike (copied below) is currently the best shot?

Pseudo code:

< ... accept="" onDrop={file => {
 if(!file.name.endsWith('.csv')) { this.setState({ rejected: true }) }
 // doSomething();
} >

Are there any plans for extending the accept prop in the same way file inputs work? When users browse files, it's nice to have them filtered by the extension(s) that'll work.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant