I\'m using the JQuery Form plugin to do a file upload on an ASP.NET MVC application. I\'ve learned that since an iframe is used for file uploads (rather than XMLHttpRequest
I just stumbled across this question and later found better solution, so here it is(for everybody who gets here from google):
jQuery form plugin has two options that might help in this case.
if you are using post request, it seems that it is always using the iframe, so if you don't need file uploads, setting iframe = false in the Form options helped in my case.
If you need iframe for fileuploads, you can use data property of the options to fool the
IsAjaxRequest() setting : data: { "X-Requested-With": "XMLHttpRequest" }
Full script with both options looks like that:
$('#someform').ajaxForm(
{
dataType: 'json',
success: onSuccess,
error: onError,
iframe: false
data: { "X-Requested-With": "XMLHttpRequest" }
}
);