I\'m in the process of trying to get the jQuery plugin, Uploadify, to work with ASP.NET MVC.
I\'ve got the plugin showing up fine with the following JavaScript snipp
The problem might be that you need to specify that the action you are uploading to is set to Post...it won't work with the action as a Get action.
So, this:
public string Upload(HttpPostedFileBase FileData)
{
//do something
}
Should be this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Upload(HttpPostedFileBase FileData)
{
//do something
}
Also, be aware that if you are using this in a "logged in" section of your site, you should take a look here for a known bug with uploadify and authentication: http://geekswithblogs.net/apopovsky/archive/2009/05/06/working-around-flash-cookie-bug-in-asp.net-mvc.aspx
Also, just an aside, there are several ways in MVC to handle file uploads (using Request.Files as per Rory Fitzpatrick's suggestion, as well as passing the HttpPostedFileBase file as an argument in the action definition). It shouldn't really matter in order to get Uploadify to work.