Git Product home page Git Product logo

Comments (4)

hackingharold avatar hackingharold commented on June 2, 2024

Hi @alexandis,

to allow directory selection in the open file dialog, just add the webkitdirectory attribute to your <input type="file" /> element. Hope this helps.

from ngx-dropzone.

alexandis avatar alexandis commented on June 2, 2024

When I use this attribute - there is a system message, offering me to upload files somewhere (when I agree - nothing happens). It is not an expected behavior for me, saying honestly. What I would like to have instead - selecting folder acted in the same way as if I just "drag-n-drop"-ed this folder, so the same handler invoked which I now assigned to drop event... I've tried to assign handler to submit, supposing "Upload" would invoke it - but it was not invoked. event.target.files in change event returns 0 elements too. Don't have idea what's going on. Probably I just need to give up the idea of using webkitdirectory...

from ngx-dropzone.

hackingharold avatar hackingharold commented on June 2, 2024

Hi @alexandis,

when using the webkitdirectory attribute, the native open file dialog is instructed to allow only folder selection which works fine if the browser supports it. In this case, the (change) event of the <input type="file" /> element is invoked and returns a flat file list with the webkitRelativePath property set on each item.
Using the same handler for both selecting and dropping is not possible because they behave totally different.

Please try dropping a folder and selecting one from the system dialog with a minimal example, starting from

...
<input type="file" fileInput webkitdirectory multiple />
...

If you have any further issues, provide some code examples please.

from ngx-dropzone.

alexandis avatar alexandis commented on June 2, 2024

I've tried webkitdirectory again with ngModelChange - at least it process ALL the files, even if there are thousands of them. But - this standard dialog does not allow me selecting several folders... :( so it is not so flexible as drag-n-drop, unfortunately.
Anyway, I think I can close the original bug, because - with specific limitations - the directory selection DOES work. Thank you for your suggestions and advices.

from ngx-dropzone.

Related Issues (9)

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.