Giter VIP home page Giter VIP logo

Comments (4)

alexcjohnson avatar alexcjohnson commented on June 12, 2024

A reasonable request, but I don't think browsers allow that, for security purposes. From https://developer.mozilla.org/en-US/docs/Web/API/FileReader:

FileReader can only access the contents of files that the user has explicitly selected, either using an HTML <input type="file"> element or by drag and drop.

ie they want users to be very explicit about every file they're uploading.

from dash-core-components.

shanepalmer1 avatar shanepalmer1 commented on June 12, 2024

@alexcjohnson Thanks for the response. I can definitely see how this would be a security concern after looking at the link you sent. For our project the application wouldn't be hosted on the web. I came across this post on stack overflow yesterday where it looks like it is possible using HTML form and input tags. Unfortunately, I couldn't get this solution to mesh with Dash components.

Nevertheless, I'll settle for prompting the user with instructions and catching any missing files. Thanks again.

T

from dash-core-components.

alexcjohnson avatar alexcjohnson commented on June 12, 2024

Oh interesting - I had never seen webkitdirectory, though it's been around for years in essentially all browsers - I guess they decided the risk is acceptable? That said, it's not supported by the react-dropzone project we use for dcc.Upload, and MDN cautions:

Though originally implemented only for WebKit-based browsers, webkitdirectory is also usable in Microsoft Edge as well as Firefox 50 and later. However, even though it has relatively broad support, it is still not standard and should not be used unless you have no alternative.

Anyway if anyone is motivated to try and add this support into react-dropzone we'd be glad to extend that support into Dash.

from dash-core-components.

thakkarparth007 avatar thakkarparth007 commented on June 12, 2024

@alexcjohnson react-dropzone now seems to support folders

from dash-core-components.

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.