Good afternoon,
I have the following block of code:
@using (Html.BeginForm("Upload", "Orders", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="attach" id="attach" multiple />
<input id="btnAttach" value="Upload" />
}
and I want that instead of using the html.beginform to use a $ ajax to consume it, my question is how I create the data based on the files that I select in my input id = attach to consume my web service
$("$btnAttach").on("click", function() {
$.ajax({
url: "/order/Upload/",
type: "POST",
data: /* form data here */,
success: SuccessCallback,
error: FailureCallback
});
});
since with the first method it gives me a lot of trouble to return an approved response to the html to be processed