23 / resumable.js

A JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable/restartable uploads via the HTML5 File API.
MIT License
4.67k stars 611 forks source link

drop directory and fileType parameters problems #486

Closed SuperPat45 closed 6 years ago

SuperPat45 commented 6 years ago

I want to only accept all image types so I set the fileType options to ["image/*"] and I have some problems when dropping directory containing images:

On firefox: type is empty in the file object when dropping directory, so no files can be added at all to the upload list:

image.jpg has type not allowed, please upload files of type image/*.

So we need to add each extensions ["image/*",".png",".jsp",".jpeg","gif","bmp",".svg" .... ] Or Resumable.js should be, perhaps, ignore the type checking in firefox for dropped folders

On Chrome: Windows create an hidden Thumbs.db file in each directory containing images or videos. Some image was inserted in the list but this message appear:

Thumbs.db has type not allowed, please upload files of type image/*.

So I can easily define my own fileTypeErrorCallback function to block this message for this file. But, more annoying, reaming images was not added in the list. This is due to the "return false;" after the line "o.fileTypeErrorCallback(file, errorCount++);" Why not allow to continue inserting other files even when one has been ignored for invalid type?

On Edge: Hidden files are not dropped, so it works fine.

On IE: Drop has no effect as IE does nos support dropping directory...

SuperPat45 commented 6 years ago

I filled an issue on the Firefox Bug tracker https://bugzilla.mozilla.org/show_bug.cgi?id=1477745