The combination of httpfilecollection and httppostedfile can be completed.
Front end
< ASP: fileupload ID = " Fileupload1 " Runat = " Server " />
< BR />
< ASP: fileupload ID = " Fileupload2 " Runat = " Server " />
< BR />
< ASP: fileupload ID = " Fileupload3 " Runat = " Server " />
< BR />
< ASP: button ID = " Button1 " Runat = " Server " Onclick = " Button#click " Text = " Button " />
< BR />
< ASP: Label ID = " Label1 " Runat = " Server " > </ ASP: Label >
Backend
String Filepath = Server. mappath ( "" ) + " \ Uploadfiles \\ " ;
Httpfilecollection uploadfiles = Request. files;
For ( Int I = 0 ; I < Uploadfiles. Count; I ++ )
{
Httppostedfile userpostfile = Uploadfiles [I];
Try
{
If (Userpostfile. contentlength > 0 )
{
Userpostfile. saveas (filepath + Path. getfilename (userpostfile. filename ));
Label1.text = " Uploaded successfully! " ;
}
}
Catch (Exception ex)
{
Label1.text = " Error: " + Ex. message;
}
}