在ASP.NET中实现多文件上传
来源:互联网 发布:用友软件固定资产模块 编辑:程序博客网 时间:2024/05/20 03:06
private Boolean SaveFiles()
{
//得到File表单元素
HttpFileCollection files = HttpContext.Current.Request.Files;
try
{
for(int intCount= 0; intCount< files.Count; intCount++)
{
HttpPostedFile postedFile = files[intCount];
string fileName, fileExtension;
//获得文件名字
fileName = System.IO.Path.GetFileName(postedFile.FileName);
if (fileName != "")
{
//获得文件名扩展
fileExtension = System.IO.Path.GetExtension(fileName);
//可根据不同的扩展名字,保存文件到不同的文件夹
//注意:可能要修改你的文件夹的匿名写入权限。
postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("upFiles/") + fileName);
}
}
return true;
}
catch(System.Exception Ex)
{
return false;
}
}
{
//得到File表单元素
HttpFileCollection files = HttpContext.Current.Request.Files;
try
{
for(int intCount= 0; intCount< files.Count; intCount++)
{
HttpPostedFile postedFile = files[intCount];
string fileName, fileExtension;
//获得文件名字
fileName = System.IO.Path.GetFileName(postedFile.FileName);
if (fileName != "")
{
//获得文件名扩展
fileExtension = System.IO.Path.GetExtension(fileName);
//可根据不同的扩展名字,保存文件到不同的文件夹
//注意:可能要修改你的文件夹的匿名写入权限。
postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("upFiles/") + fileName);
}
}
return true;
}
catch(System.Exception Ex)
{
return false;
}
}
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传(C#)
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传-孟宪会
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- 在ASP.NET中实现多文件上传
- ziliao
- javascript 实现 DataGrid中复选框的全选
- Firefox中的XPath
- ubuntu7.04下QQ的安装和使用
- 在SQL Server中快速删除重复记录(多图)
- 在ASP.NET中实现多文件上传
- 安装IE7--无需验证
- 用asp.net还原与恢复sqlserver数据库(转)
- 书谷:能给你免费送书的网站
- 工作流一些资料
- 一些sql语句的详细解释
- js对div的控制(比较有意思)
- 一个拷贝整个文件夹(包括子文件夹)的方法
- 关于linux下的嵌入式文件系统以及flash文件系统选择