public ActionResult UploadImg(FormCollection form) // IsWater 水印 IsThumbnail 压缩
 {
     HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
     //List<string> urls = new List<string>();
     if (files.Count < 0)
     {
         return Json(new ResponseMessage() { Content = "请选择要上传的图片", Message = "请选择要上传的图片" });
     }
     bool isWater = false;
     bool isThumbnail = true;
     UpLoad upload = new UpLoad(20480, 960, "products");
     string imgUrl = string.Empty;
     for (int i = 0; i < files.Count; i++)
     {
         //var path = Request.MapPath("/uploads/");
         //if (!System.IO.File.Exists(path))
         //{
         //    System.IO.Directory.CreateDirectory(path);
         //}
         //files[i].SaveAs(path + files[i].FileName);
         imgUrl = upload.FileSaveAs(files[i], isThumbnail, isWater);
         //urls.Add(imgUrl);
     }
     return Json(new ResponseMessage() { Content = imgUrl, Message = "上传图片成功" });
 }
 public ActionResult UploadImgTest(int width, int height, string folder)
 {
     HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
     if (files.Count < 0)
     {
         return Json(new { error = 1, message = "请选择要上传的图片" });
     }
     UpLoad upload = new UpLoad(1024*4,width,height,folder);
     string imgUrl = string.Empty;
     for (int i = 0; i < files.Count; i++)
     {
         imgUrl = upload.FileSaveAs(files[i],width,height);
     }
     return Json(new { error = 0, url = imgUrl });
 }
 public ActionResult AreaUploadImg()
 {
     HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
     if (files.Count < 0)
     {
         return Json(new { error = 1, message = "请选择要上传的图片" });
     }
     bool isWater = false;
     bool isThumbnail = false;
     UpLoad upload = new UpLoad(20480, 960, "products");
     string imgUrl = string.Empty;
     for (int i = 0; i < files.Count; i++)
     {
         imgUrl = upload.FileSaveAs(files[i], isThumbnail, isWater);
     }
     return Json(new { error = 0, url = imgUrl });
 }