Can I use the following jQuery code to perform file upload using post method of an Ajax request ?
$.ajax({
type: "POST",
timeout: 50000,
url: url,
data: dataString,
success: function (data) {
alert('success');
return false;
}
});
If it is possible, do I need to fill "data" part? Is it the correct way? I only post the file to the server side.
I have been Googling around, but what I found was a plugin while in my plan I do not want to use it. At least for the moment.
转载于:https://stackoverflow.com/questions/2320069/jquery-ajax-file-upload