Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello!

I has a project based on Asp.Net MVC2. There is a file uploader on the page. I use $.ajaxFileUpload to send image to controller.

Controller has a simple method, which accept image, do some calculations and return JSON object:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UploadMainPhoto(HttpPostedFileBase photo)
{
       ......
    return Json(new { path = "new image path" }, "text/json");
}


In IE it works ok. But Mozilla opens save dialog and offer to save JSON message.
Does anybody knows solution?

Thanks :)
Posted

1 solution

Change your ActionResult to JsonResult. That will direct the content/type and headers correctly and should eliminate FF thinking it's a text file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900