public ActionResult ImageUploadToAli() { var imageName = string.Empty; var msg = string.Empty; var imageUrl = string.Empty; if (Request.Files.Count > 0) { try { var Imgfile = Request.Files[0]; var buffer = new byte[Imgfile.ContentLength]; Imgfile.InputStream.Read(buffer, 0, buffer.Length); var uploadResult = ImageUploadHelper.UpdateLoadImage(buffer); if (uploadResult.Item1) { imageUrl = ImageHelper.GetImageUrl(uploadResult.Item2); msg = "上传成功"; } else { msg = uploadResult.Item2; } } catch (Exception ex) { msg = ex.Message; } } else { msg = "请选择文件"; } return(Json(new { Image = imageUrl, Msg = msg }, "text/html")); }