<div> <asp:FileUpload ID="FileUpload1" runat="server" /> <asp:LinkButton ID="LinkButton1" runat="server">upload multiple files</asp:LinkButton> <br /> <asp:Button ID="Button1" runat="server" Text="upload" OnClick="Button1_Click" /> <br /> <asp:Label ID="Span1" runat="server"></asp:Label> </div>
protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFiles) { foreach (HttpPostedFile uploadedFile in FileUpload1.PostedFiles) { uploadedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Images/"), uploadedFile.FileName)); Span1.Text += String.Format("{0}<br />", uploadedFile.FileName); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)