GithubHelp home page GithubHelp logo

Comments (8)

jacobedawson avatar jacobedawson commented on June 21, 2024 3

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.

from react-papaparse.

bobbyrinaldy avatar bobbyrinaldy commented on June 21, 2024 3

@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

from react-papaparse.

Bunlong avatar Bunlong commented on June 21, 2024

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

from react-papaparse.

jacobedawson avatar jacobedawson commented on June 21, 2024

Thanks @bobbyrinaldy, much appreciated :)

from react-papaparse.

exaucae avatar exaucae commented on June 21, 2024

Any progress so far?

from react-papaparse.

Bunlong avatar Bunlong commented on June 21, 2024

@exaucae Could you try bobbyrinaldy solution?

from react-papaparse.

exaucae avatar exaucae commented on June 21, 2024

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.

from react-papaparse.

alex-airbox avatar alex-airbox commented on June 21, 2024

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.

from react-papaparse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.