File Uploading Using ASP.NET

Skip Navigation LinksIrocon > Blog > 2004 > February, 2004 > February 19, 2004 > File Uploading Using ASP.NET

File Uploading Using ASP.NET

By: Karl Moore

In the golden olden days of ASP, managing a file upload was pretty difficult. Most developers reverted to digging deep in their wallets to purchase a third-party add-on to help them achieve the desired result. No longer.

With ASP.NET, you can now upload files with practically a few lines of code. And the following four easy-to-follow steps show you exactly how to do it.

1. Add a File Field control to your form. You'll find this under the HTML tab on the toolbox. You'll have seen this control when uploading attachments through Hotmail, or when sending files to a Web site.


2. Right-click on the File Field control and check the Run as Server Control option. This allows you to manipulate the control in code, sort of like a less-functional ASP.NET server control.


3. Change the ID of your File Field control to something more understandable, such as "fileUpload".


4. Enter the HTML view of your Web form and find the opening

tag. You'll need to edit this to add the parameter encType="multipart/form-data".

more...
Last Updated:Thursday, September 02, 2010By:alferoSource#

Would you like to comment?

Sign in with your OpenID. If you do not know what OpenID is, find out.