Uploading files with MVC 3

后端 未结 3 1158
走了就别回头了
走了就别回头了 2021-01-15 01:23

I\'m growing thin learving mvc3. I have the following code in my controller

    [HttpPost]
    public ActionResult Accreditation(Accreditation accreditation)         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-15 02:01

    Are really uploading data? I'd suggest you use this way. Create a parameter of type HttpPostedFileBase with the same name as the input field and test for its content length property.

    Don't forget to use the same name for the parameter and for the input tag.

    Checking this link will the fastest way for you to move on.

    MVC 3 file upload and model binding

提交回复
热议问题