No files are loaded with fileupload aspx control

1

I have a doubt, there is control <asp:FileUpload ID="ImagenArchivo" AllowMultiple="true" runat="server" Width="132px" /> and it has activated the selection of multiple files but when I get that information in my code vb only takes the first selected file and ignores the others, I have had conflicts and I do not know how or because this phenomenon happens, will it be the version of the aspx or vb?

    
asked by Jose Manuel 07.07.2017 в 15:58
source

1 answer

0

The FileUpload.AllowMultiple property is available from the .NET Framework 4.5 or higher . So you must ensure that your project compiles with a compatible version of Framework.

To use it, you must do the following:

.ASPX

<asp:FileUpload ID="fileImages" AllowMultiple="true" runat="server" />

.VB

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
    
answered by 07.07.2017 в 18:05