When dragging, dropping, or selecting a file through a form, IE 9/10/11 only accept JPEG and PNG files, but reject extensions JPG and GIF. Both the code I use below and the demo URL https://css-tricks.com/examples/DragAvatar/ have this problem. When dropping a JPG or GIF file on the demo, IE throws up a message box titled "Message from webpage", that reports "Only images are allowed!"
Renaming GIFs doesn't help, while renaming JPG to JPEG does work, but is a work-around I would not want to ask the user to perform. Is this a bug? Is it possible to rename the extension when the drag event fires? What can be done to support GIFs? Chrome and FF have no issues.
reader = new FileReader();
reader.onload = (function (theFile) {
return function (event) {
theHTML = '<img style="width: 100%;" src="' + event.target.result + '" />';
document.getElementById('dropTarget').innerHTML = theHTML;
};}(file));
reader.readAsDataURL(file);