i have developed a web application using asp.net mvc4 and razor. in my application there\'s a file upload control to upload an image and save in a temporary location.
<Its very difficult to understand what is the problem with your code. But may be you want to use alternative way. You need to add the reference to System.Web.Helpers namespace and try the following code.
[HttpPost]
public ActionResult Index(HttpPostedFileBase file)
{
WebImage img = new WebImage(file.InputStream);
if (img.Width > 1000)
img.Resize(1000, 1000);
img.Save("path");
return View();
}
Also this class supports the crop, flip, watermark operation etc.