怎样批量上传图片?
要个简单的例子,能运行的
------解决方案--------------------csdn资源:批量上传
------解决方案--------------------可以用到第三方控件AspnetUpload
具体是在页面建立三个fileupload,注意是这三个是Html控件,把name改成File1;
page_load事件里代码:
string path=path.combine(request.physicalApplicationPath,"UpFiles")
if(!directory.Exists(path))
directory.CreateDirectory(path)
AspnetUpLoad upldr=new AspnetUpload();
upldr.set_UploadFolder(path);
最后在上传按钮里的代码
string path=path.combine(request.physicalApplicationPath,"UpFiles")
UploadFileCollection files=AspnetUpload.GetUploadFiles("File1")
foreach(UploadFile file in files)
{
if(file!=null)
{ file.save(Path.combine(path,path.GetFileName(file.get_FileName())))
}
}
------解决方案--------------------http://www.cnblogs.com/tzwhx/archive/2009/02/01/1303801.html
http://www.cnblogs.com/baaigeini/archive/2007/03/29/693086.aspx
------解决方案--------------------楼上有很多文章可以一看,值得回味!
------解决方案--------------------网上找一下嘛,很多的
------解决方案--------------------看下...
------解决方案--------------------
------解决方案--------------------顶