时间:2021-07-01 10:21:17 帮助过:3人阅读
前台代码:
@{ Layout = null; }
后台代码:
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Web; using System.Web.Mvc; namespace IceMvc.Controllers { public class UploadController : Controller { // // GET: /Upload/ public ActionResult Index() { return View(); } [HttpPost] public ActionResult Upload() { var filesList = Request.Files; for (int i = 0; i < filesList.Count; i++) { var file = filesList[i]; if (file.ContentLength > 0) { if (file.ContentLength > 5242880) { return Content("
以上就是针对jquery.form.js实现异步上传的方法,希望对大家的学习有所帮助。