manyfold icon indicating copy to clipboard operation
manyfold copied to clipboard

Dragging a folder into uploader creates separate models for all files

Open Floppy opened this issue 1 year ago • 7 comments

That's "correct" behaviour, but confusing. We should either forbid dropping a folder, or detect it and create a single model from the result.

Floppy avatar Jul 04 '24 18:07 Floppy

There's another possibility; if people drag folders, we might get the folder name in the original path, so we could actually use it to make a new model with those files. Iiiiiiinteresting.

Floppy avatar Jul 17 '24 10:07 Floppy

I've asked if disabling folder drag/drop is possible at https://community.transloadit.com/t/prevent-folder-dropping-on-dashboard/17262, in case there's a quick fix.

Floppy avatar Sep 13 '24 14:09 Floppy

Resolution for this ticket is to prevent folder drag/drop, but #2681 is perhaps a better long-term approach.

Floppy avatar Sep 16 '24 10:09 Floppy

I'm not actually sure that the HTML Drag and Drop API distinguishes between files and folders; so anything other than #2681 might not be possible.

Floppy avatar Sep 18 '24 11:09 Floppy

https://stackoverflow.com/questions/25016442/how-to-distinguish-if-a-file-or-folder-is-being-dragged-prior-to-it-being-droppe has some solutions, and points to https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/files as the actual thing we use to discard 0-size files, which will include folders.

Floppy avatar Sep 18 '24 21:09 Floppy

Uppy actually has code in it to do the folder recursion, so our best bet is probably to fork it and add an option.

Floppy avatar Sep 20 '24 21:09 Floppy

Yep, so this is an Uppy feature addition that would be a good first issue for someone with Javascript skills!

Floppy avatar Oct 06 '24 11:10 Floppy

This is actually resolved now with #3175

Floppy avatar Oct 31 '25 11:10 Floppy