javascript - upload file using xhr2 on IE 10 work only for text files -
i try use xhr2 upload files . work fine in ff , chrome when try on ie10 send text files no image no rar.
my script code
$("#uploader").click(function () { alert("upload"); var fileinput = document.getelementbyid("fileuploader"); var file = fileinput.files[0]; var fd = new formdata(); fd.append("files", file); alert(file.size); var xhr = new xmlhttprequest(); xhr.open("post", 'http://localhost:7128/filemanager/uplader.ashx'); xhr.setrequestheader("x-file-name", file.name); xhr.setrequestheader("x-file-size", file.size); xhr.setrequestheader("x-file-type", file.type); xhr.send(fd);
});
Comments
Post a Comment