I have implemented Uploadify plugin on my site (site has authentication/authorization implemented). And it works fine except it display me 302 HTTP error.
I google a little and find this article but I still missing something. I suspect that error is somewhere in JS part. I saw similar questions here on stack and read them all but still have a problem :(
<script>
$(document).ready(function () {
$('#file_upload').uploadify({
'uploader': '../../Scripts/uploadify/uploadify.swf',
'script': '../../ImageController/UploadImage',
'cancelImg': '../../Scripts/uploadify/cancel.png',
'scriptData': { 'token': '@Request.Cookies[FormsAuthentication.FormsCookieName].Value' },
'folder': '/uploads',
'auto': false,
'buttonText': 'Upload image',
'displayData': 'speed',
'multi': 'true',
'fileExt': '*.jpg;*.gif;*.png',
'fileDesc': 'Image Files',
onError: function (event, queueID, fileObj, errorObj) {
alert("Error!!! Type: [" + errorObj.type + "] Info [" + errorObj.info + "]");
}
});
});
</script>
[HttpPost]
[TokenizedAuthorizeAttribute]
public ActionResult UploadImage(string token, string returnUrl)
{
//wip
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(token);
if (ticket != null)
{
var identity = new FormsIdentity(ticket);
if (identity.IsAuthenticated)