-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regressions in 3.0.0 #39
Comments
This was referenced Apr 19, 2018
Released as 4.0.0. |
Thank you! Yeah, so basically, if we want folders, we should accept that there will be no/incorrect file types sometimes (bad for client-side validation). If file types are important, we should disallow folders. transloadit/uppy#364 |
@arturi Or you can do your own mime type detection based on file extensions which is what the browser is certainly doing. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dropping a folder no longer works, because we preferred the code path that uses
e.dataTransfer.files
instead ofe.dataTransfer.items
, and I also removed the code fore.dataTransfer.items
. Turns out that's how directory support was implemented. My bad for not noticing.I reverted and found another way to address these issues:
#38
#34
The new API:
We need to prefer
e.dataTransfer.items
since it gives us directory support. That object is anArray
, so theFileList
feature request is affected (Make sure we use the standard API for file drops if it's available #38). But I'll also returne.dataTransfer.items
(theFileList
) as the third argument. That way, if you need theFileList
you can still get access to it.As for the bug where the file type is sometimes empty in Chrome (Empty type for some file types in Chrome #34), that bug will return. However, if you want to, you can use the third argument to get at the
FileList
which doesn't have this Chrome bug.Note: that for both the above use cases, the
FileList
will be useless when a directory is dropped, sincee.dataTransfer.files
can't show the files within the directory. But that's just a fundamental limitation we can't get around for now.Hope this satisfies everyone.
The text was updated successfully, but these errors were encountered: