首页 > Web开发 > 详细

多文档上传文件

时间:2015-05-07 16:02:35      阅读:290      评论:0      收藏:0      [点我收藏+]

 
            HttpFileCollection Files = HttpContext.Current.Request.Files;
            for (int i = 0; i < Files.Count; i++)
            {
                HttpPostedFile PostedFile = Files[i];
                if (PostedFile.ContentLength > 0)
                {
                    string FileName = PostedFile.FileName;
                    string strExPrentFile = FileName.Substring(FileName.LastIndexOf(".") + 1);

                    string sFilePath = "/uploadfile/hotel/" + StringClass.makeFileName24() + i + strExPrentFile;
                    PostedFile.SaveAs(Server.MapPath(sFilePath));
                }
                else
                {
                    //this.LabMessage.Text = "不能上传空文件";
                }
            }
 

多文档上传文件

原文:http://www.cnblogs.com/siyechenmu/p/4484774.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!