I know it's quite old question but I had exactly the same problem today so I will answer it.
There is a bug in the Flash plg for Firefox. It doesn't send cookie when uploading files.
My solution:
1) Create new authorize attribute
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class FlashAuthorizeAttribute : AuthorizeAttribute
{
private const string AUTH_TOKEN = "AuthenticationToken4Flash";
protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext)
{
string authToken = httpContext.Request.Params[AUTH_TOKEN];
if (authToken != null)
{
FormsAuthenticationTicket authForm = FormsAuthentication.Decrypt(authToken);
if (authForm != null)
{
FormsIdentity formIdentity = new FormsIdentity(authForm);
string[] userRoles = System.Web.Security.Roles.GetRolesForUser(formIdentity.Name);
GenericPrincipal userPrincipal = new GenericPrincipal(formIdentity, userRoles);
httpContext.User = userPrincipal;
}
}
return base.AuthorizeCore(httpContext);
}
}
2) Controller
[FlashAuthorize]
public ActionResult AsyncUpload()
{
HttpPostedFileBase file = Request.Files[0];
}
3) Modify your js (formData, scriptData didn't work for me so I added a query string)
upload_url: '@Url.Action("AsyncUpload", "Profile")' +'?AuthenticationToken4Flash=' + '@(Request.Cookies[FormsAuthentication.FormsCookieName]==null ? string.Empty : Request.Cookies[FormsAuthentication.FormsCookieName].Value)',
I hope it will help someone