Sample project plugin jquery File Upload plugin implemented in ASP .NET MVC3

前端 未结 2 1675
说谎
说谎 2021-01-30 15:24

I need to implement in my project ASP .NET MVC3 the jQuery file upload plugin:

http://blueimp.github.com/jQuery-File-Upload/

I have been Googling and I haven\'t

2条回答
  •  日久生厌
    2021-01-30 15:40

    Did you read the documentation of the plugin that you are trying to use? Did you try the basic plugin functionality? Did you try to create a new ASP.NET MVC 3 application in Visual Studio using the default template?

    Did you try writing a simple controller:

    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        [HttpPost]
        public ActionResult Index(IEnumerable files)
        {
            foreach (var file in files)
            {
                var filename = Path.Combine(Server.MapPath("~/App_Data"), file.FileName);
                file.SaveAs(filename);
            }
            return Json(files.Select(x => new { name = x.FileName }));
        }
    }
    

    and a corresponding view:

    
    
    
    
    
    
    
    
    

    If you haven't, I invite you to do so.

提交回复
热议问题