FileUpload1 在部分浏览器中实现多选

Posted 糖果小宝~

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了FileUpload1 在部分浏览器中实现多选相关的知识,希望对你有一定的参考价值。

 <asp:FileUpload ID="FileUpload1" multiple runat="server" />

 

添加    multiple  这个就可以  

ie 不行   有些浏览器是可以支持的


        HttpFileCollection files = HttpContext.Current.Request.Files;
        for (int iFile = 0; iFile < files.Count; iFile++)
        {

            //检查文件扩展名字
            HttpPostedFile postedFile = files[iFile];
            string conentType = Path.GetExtension(postedFile.FileName).ToLower();
            if (conentType == ".jpg" || conentType == ".jpeg" || conentType == ".png" || conentType == ".bmp" || conentType == ".gif")
            {
             
            }
        }
      保存方法

以上是关于FileUpload1 在部分浏览器中实现多选的主要内容,如果未能解决你的问题,请参考以下文章