javascript - How Can JPG and GIF Drag and Drop Work in IE 9/10/11? -
when dragging, dropping, or selecting file through form, ie 9/10/11 accept jpeg , png files, reject extensions jpg , gif. both code use below , demo url https://css-tricks.com/examples/dragavatar/ have problem. when dropping jpg or gif file on demo, ie throws message box titled "message webpage", reports "only images allowed!"
renaming gifs doesn't help, while renaming jpg jpeg work, work-around not want ask user perform. bug? possible rename extension when drag event fires? can done support gifs? chrome , 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);
i think solution problem use html5 drag , drop.
http://www.w3schools.com/html/html5_draganddrop.asp
supported ie9 , other modern browsers..
Comments
Post a Comment