manyfold
manyfold copied to clipboard
Dragging a folder into uploader creates separate models for all files
That's "correct" behaviour, but confusing. We should either forbid dropping a folder, or detect it and create a single model from the result.
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.
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.
Resolution for this ticket is to prevent folder drag/drop, but #2681 is perhaps a better long-term approach.
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.
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.
Uppy actually has code in it to do the folder recursion, so our best bet is probably to fork it and add an option.
Yep, so this is an Uppy feature addition that would be a good first issue for someone with Javascript skills!
This is actually resolved now with #3175