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.

Upload Files from an Webpage
Date 11/25/2009    Tags    (0)

Often I find a need to upload files (ussually images) directly from a webpage to my web server. Sure I could use FTP or Visual Studio (Publish Website), but it's a heck of a lot easier if I have a simple webpage interface to do so.

The following code will allow you to upload as many as five files at once (this can easily be changed by simply adding or removing the file input controls from the page) and return whether the upload was successful or what errors were encountered.

In the .aspx file, setup the controls for entering your files and uploading them:

<b><font size=4>Upload Files</font></b><br />
<br />

<asp:Label ID="lblMessage" runat="server" ForeColor="Red" />

<asp:Panel ID="pnlUploadFiles" runat="server">
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" />

<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

This article has been view 669 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)