Below is my ajax call
How to send a file uploaded to action method in the following format only using ajax.
The parameter in the data file will not change.
$.ajax({
type: "Post",
url: '/Student/SaveApplication',
data: "mobilenumber=" + mobilenumber + ""a=" + quota + "&subjectList=" + subjectList,
datatype: 'json',
contentType: "multipart/form-data",
processData: false,
cache: false,
success: function (op) {
}
});
The action method will also be parameterized
public ActionResult SaveApplication(string subjectList,string mobilenumber,string quota)
{
//code to save data
}
7 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gnanavel SekarPosted Feb 28, 2017, 7:42 AM
JohnPosted Feb 28, 2017, 6:54 AM
JohnPosted Feb 28, 2017, 6:48 AM
Gnanavel SekarPosted Feb 28, 2017, 6:42 AM
Joginder BangerPosted Feb 28, 2017, 6:33 AM
JohnPosted Feb 28, 2017, 6:26 AM
Gnanavel SekarPosted Feb 28, 2017, 6:24 AM