File upload using HTML5's drag and drop in Asp.net

后端 未结 1 855
不思量自难忘°
不思量自难忘° 2020-12-17 02:52

Am trying to upload a file using HTML5\'s DnD and File API. Am not to sure how to send form data to the server, i tried to send using XMLHttpRequest but was not successful.

相关标签:
1条回答
  • 2020-12-17 03:51

    Jeezzz!! Its works fine in IE, i was testing in Chrome v 28 since few days. In IE file gets uploaded fine. (tested multiple file uploads). So to make it work in Chrome i had to make few changes. * Mistakes made

    • In chrome While debugging client-side i found that var xhr = XMLHttpRequest() throws an error, "dom object constructor cannot be called as a function" So replaced it with

      var xhr=new XMLHttpRequest(); and removed xhr.setRequestHeader("Content-type", "multipart/form-data"); (Not sure why but xhr.send() results in ispostback value to be false?? )

    • Comments are appreciated. Link to full code: http://programmingusingdotnet.blogspot.com/2013/08/aspnet-drag-and-drop-file-uploads-using.html

    0 讨论(0)
提交回复
热议问题