Debopriyo Dey

Debopriyo Dey

  • NA
  • 51
  • 15.1k

Upload files and register simultaneously by a single AJAX

Oct 13 2017 6:58 AM
I am able to Upload files by AJAX call through a handler by appending the file name and file and sending it to handler as shown below
 
var fileUpload = $("#file").get(0);
var files = fileUpload.files;
var test = new FormData();
for (var i = 0; i < files.length; i++) {
   test.append(files[i].name, files[i]);
}
 
And while Registration, stringifying the values as shown and sending the JSON to a webmethod in aspx.cs page.
 
var requestData = { "A": B, "AA": BB, "AAA": BBB },
data: JSON.stringify(requestData) 
 
Now how can i do both the processes in a single AJAX call and further how can I retreive the values in ProcessRequest of Handler.
 

Answers (1)