-
Notifications
You must be signed in to change notification settings - Fork 14
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
File type validation behaves differently when dropping a folder #36
Comments
You can can try to see how the browser interprets the files using the fileValidateTypeDetectType hook, maybe there's a difference and you can use the hook to correct the browser interpretation. |
Thanks for your response. I used fileValidateTypeDetectType to determine the types of the files added. But when adding the same files by adding the containing directory, the files are recognized as "object blob" and the type of the DOCX-blob is empty, whereas the file type of the image-blob ist still shown correctly (see second image below). |
I'll see if I have some time to investigate this next week. |
Thanks in advance! |
@alex7654 Just checked. The browser doesn't recognise the file type when read from a folder vs when a file is dropped on its own (don't know why). When dropping a folder FilePond tries to guesstimate the file extension and creates a Blob instead of a File because it can't create File objects on IE11. I'm pushing a fix (4.23.1) where it doesn't create a Blob if the type cannot be guesstimated. But still that means the type is empty and you will have to correct for it in the |
Thank you for the update! |
I set up file type validation with the folloing accepted types:
acceptedFileTypes: [
'image/',
'audio/',
'video/',
'text/',
'application/pdf',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-powerpoint',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/application/vnd.openxmlformats-officedocument.presentationml.slideshow',
'application/x-zip-compressed',
],
When dropping files directly (not dropping a folder) it works perfectly (see attached image validateType_directly.png).
When dropping a folder containing the exactly same files as before, some (but not all) files types are blocked (see attached image validateType_folder.png), although they should be accepted.
So it seems, files are processed differently when a folder ist dropped.
Any advice is highly appreciated.
PS:
After deactivation of FilePondPluginFileValidateType, upload works correctly, no matter if the files are contained in a folder or not (of course all files are accepted in this case).
The text was updated successfully, but these errors were encountered: