GithubHelp home page GithubHelp logo

Comments (3)

readeral avatar readeral commented on June 2, 2024

You're not restricted to PDF only, if your component only accepts PDF format you need to add more types to the accept prop array.

Have a read through the MDN entry on HTML drag and drop API, and the MIME type stuff, as this library is essentially a wrapper around that. https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/type

from react-butterfiles.

Misbah-Mushtaq avatar Misbah-Mushtaq commented on June 2, 2024

@readeral can you please provide an example with the below given formats in accept prop?
I tried it earlier, and it is only picking up the PDF, though it is showing multiple formats while browsing, I have added a console to the onSuccess event, and it's only logging the input when I upload PDF format.
".doc",
".docx",
".htm",
".html",
".odt",
".pdf",
".xls",
".xlsx",
".ppt",
".pptx",
".txt"

If you could please provide an example with some of the above formats other than PDF? @readeral @adrians5j

from react-butterfiles.

Misbah-Mushtaq avatar Misbah-Mushtaq commented on June 2, 2024

@readeral, I have noticed a particular scenario. If I give all these formats to accept props then it doesn't work as it should, but when I remove the prop and do it without the prop then it is accepting all types of documents.

from react-butterfiles.

Related Issues (7)

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.