How do I cast from System.Web.HttpPostedFileBase to System.Web.HttpPostedFile?

前端 未结 2 573
渐次进展
渐次进展 2021-02-19 12:56

While trying to implement an MVC file upload example on Scott Hanselman\'s blog. I ran into trouble with this example code:

foreach (string file in Request.Files         


        
2条回答
  •  有刺的猬
    2021-02-19 13:43

    The correct type to use is HttpPostedFileBase.

    HttpPostedFileBase hpf = Request.Files[file];
    

提交回复
热议问题