简体   繁体   中英

I can't get redirecttoaction to work in asp.net mvc after receiving data from flash

I'm building an action that basically handles receiving post data from a flash app,

I have no problem receiving the data.

after that, it should redirect to another controller/action

I tried Redirect, RedirectToRoute, none of them worked.

here is my code

[AcceptVerbs(HttpVerbs.Post)]
public RedirectToRouteResult Draw(FormCollection form)
{
    string bitmapDataString = Request.Params["someimagedata"];
    byte[] bitmapData = Convert.FromBase64String(bitmapDataString);
    File.WriteAllBytes(Server.MapPath("~/Images/abc.jpg"),  
    return RedirectToAction("Register", "Participant");
}

Redirects are the job of the client (browser). You're simply telling the browser that you would like it to redirect. I don't know anything about flash but note that these redirects don't work with Ajax requests either. I know that's not a full answer but may send you in the right direction while you're waiting on someone with some flash experience.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM