本文介绍了如何使用文件上传控制选择多个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对单击该文件上传control.Now,我要选择多个文件。
I have a file upload control.Now on clicking on that, I want to select multiple files.
我怎么可以这样做?
推荐答案
的<$c$c>FileUpload.AllowMultiple$c$c>物业的 .NET 4.5及更高版本将允许您控制选择多个文件。
The FileUpload.AllowMultiple
property in .NET 4.5 and higher will allow you the control to select multiple files.
<asp:FileUpload ID="fileImages" AllowMultiple="true" runat="server" />
.NET 4及以下
.NET 4 and below
<asp:FileUpload ID="fileImages" Multiple="Multiple" runat="server" />
在后回,则可以:
On the post-back, you can then:
Dim flImages As HttpFileCollection = Request.Files
For Each key As String In flImages.Keys
Dim flfile As HttpPostedFile = flImages(key)
flfile.SaveAs(yourpath & flfile.FileName)
Next
这篇关于如何使用文件上传控制选择多个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!