This article tells us to upload any file into our system by using FileUpload Control in ASP.NET 2.0.
- Add new webform to your project.
- Name it as FileUploading.aspx.
- Drag and drop FileUpload control from toolbox into webform.
- Drag and drop Button control from toolbox into webform. Put Button Text to "Upload".
- Double click on the Button Control it generates "Button1_Click" event in .cs file.
- And finally drag and drop Label control from toolbox into webform.
Create a folder in D drive with the name "Uploads"
In FileUploading.aspx.cs, write the following code under button double click "Button1_Click" event
protected void
Button1_Click(object sender, EventArgs e)
{
try
{
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(@"D:\Uploads\"
+ FileUpload1.FileName);
lblFileMsg.Text = "<b>File
Uploaded Successfully.</b><br>";
lblFileMsg.Text += "File Name :"
+ FileUpload1.FileName;
lblFileMsg.Text += "<br>File Type
:" + FileUpload1.PostedFile.ContentType;

Former memberPosted Oct 10, 2013, 7:08 AM
http://www.dotnetpools.com/2012/09/fileupload-control-in-aspnet.html