jeudi 29 octobre 2015

Javascript Drag and Drop DataTransfer Files don't have type

So I'm trying to use drag and drop with IE11 (all browsers really, but the bug is in IE). I only want certain kinds of files uploaded, and no folders.
When I get into the drop event, I scan the dataTransfer.data.files array to make sure that we are only processing files that are supported, and no folders.
Well I got some weirdness that is happening when I try to drag and drop a javascript file. When I check the files array, and specifically look at the type property on the FileObject in the file list, I have no type. Specifically I have a type of "" (empty string).
On every other browser, I am able to read the type and determine what it is. However, it's just on IE that I'm having this trouble.


Why does type property not exist on javascript files from a drop event? Could it just be this machine? If so, what could cause this?


Aucun commentaire:

Enregistrer un commentaire