Fun Infused Games  |   Smooth Operator RSS 

  Home   |    Archive   |    Subscribe   |    Search   |    About
Posts prior to 8/2/2010 may be missing data. If you need one of those posts, please contact and I will try and recover/find it.

A Simple Multi-File Upload Form
Date 10/18/2008    Tags    (0)

On a website I'm working on, users will often have a need to upload their own files to the web server. While I could give each user an FTP account to use, it's much easier to just build this into the administrative section of the website.

For this example, I have placed five HtmlInputFile controls (with the runat="server" flag) on my page. I also have a dropdown list that will allow you to choose which directory the files will upload to. A label control will be used to display the result of each file operation. Below is a screenshot of this form on my page:

UploadFiles Form

To create this form, first here is what goes on the ASPX file.
<asp:Label ID="lblUploadMessage" runat="server" />

<div class="PageHeading">Upload Files</div>

<br />
Use the below form to upload files to the web server. You may upload up to five files at once.<br />
<br />
<br />

Upload files to: 

<asp:DropDownList ID="ddlDirectory" runat="server">
    <asp:ListItem Value="images" Text="Images" />
    <asp:ListItem Value="documents" Text="Documents" />

<br />
<br />

<input ID="myFile1" type="File" runat="Server" size="50" /><br />
<input ID="myFile2" type="File" runat="Server" size="50" /><br />
<input ID="myFile3" type="File" runat="Server" size="5

This article has been view 1204 times.


No comments for this article.

Add Comments

Name *
  Name the animal in the picture below:

Comment *
Insert Cancel

Xbox (1)  C# (14)  Visual Studio (1)  Cool (2)  iOS (3)  PC (1)  Rant (50)  Sports (11)  XBLIG (32)  Abduction Action (1)  Design (2)  Fin (1)  Volchaos (11)  VolChaos (1)  Nastier (4)  Game Dev (11)  Abdction Action! (1) (18)  Nasty (34)  SQL (1)  XNA (40)  World of Chalk (2)  Video Games (7)  Web (19)  Abduction Action! (27)  Hypership (28)  WP7 (8)  Advise (14)  FIN (20)  Trivia or Die (3)  Development (13)  Absurd (2)  Trivia Or Die (1)