0

I call webservice method with HTTPXMLRequest. But count of context.request.files in asp.net webservice is zero! How can I fix it?

This is my ajax request code:

   ....

   var files = event.originalEvent.dataTransfer.files;
   upload(files)
 /* ---------------------------------------------------- */

   function upload(files) {

       for (var i = 0; i < files.length; i++) {

           xhr = new XMLHttpRequest();
           xhr.upload.addEventListener('progress', uploadProgress, false);
           xhr.onreadystatechange = stateChange;
           xhr.open('POST', "WebService.asmx/HelloWorld", true);
           xhr.setRequestHeader('X-FILE-NAME', files[i].name);
           xhr.send(files[i]);
       
      }
  }
4

0 に答える 0