I am using .NET MVC3 along with JQuery uploadify plugin and I seem to get a HTTP 302 error from the returned 'onError' Uploadify object.
When I check in firebug, it seems there isn't even anything getting posted back to the server, just the get for the cancelImg.
Can anyone help?
The following is my view code and in the global.asax file I have the "/settings/terms-and-conditions/upload" part setup to go to my controller which is a follows also
$(document).ready(function () {
var t = '@(Request.Cookies[FormsAuthentication.FormsCookieName] != null ? Request.Cookies[FormsAuthentication.FormsCookieName].Value : string.Empty)';
$("#file_upload").uploadify({
'uploader': '@Url.Content("~/_media/scripts/uploadify/uploadify.swf")',
'cancelImg': '@Url.Content("~/_media/scripts/uploadify/cancel.png")',
'buttonText': 'Upload Files',
'scriptData': { token: t },
'script': '/settings/terms-and-conditions/upload',
//'folder': '/uploads',
//'fileDesc': 'Image Files',
//'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': true
});
});
Controller
[AcceptVerbs(HttpVerbs.Post)]
public string Upload(HttpPostedFileBase fileData)
{
//var fileName = this.Server.MapPath("~/uploads/" + System.IO.Path.GetFileName(fileData.FileName));
//fileData.SaveAs(fileName);
return "ok";
}
its to generally to do with the following
<authorization>
<allow users="*"/>
</authorization>
From your web.config