With ASP.NET 2.0 release, file upload process became quite simple and there is no need to use third-party components anymore. There is a built-in server control called FileUpload and you are welcome to use it on our servers.

Here is a code sample:

<%@ Page Language="C#" %>

<script runat="server">
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
            try
            {
                FileUpload1.SaveAs("D:\\home\\Username\\Htdocs\\Uploads\\" +
                     FileUpload1.FileName);
                Label1.Text = "File name: " +
                     FileUpload1.PostedFile.FileName + "<br>" +
                     FileUpload1.PostedFile.ContentLength + " kb<br>" +
                     "Content type: " +
                     FileUpload1.PostedFile.ContentType;
            }
            catch (Exception ex)
            {
                Label1.Text = "ERROR: " + ex.Message.ToString();
            }
        else
        {
            Label1.Text = "You have not specified a file.";
        }
    }
</script>

<html  >
<head runat="server">
    <title>Upload Files</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FileUpload ID="FileUpload1" runat="server" /><br />
        <br />
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
         Text="Upload File" />&nbsp;<br />
        <br />
        <asp:Label ID="Label1" runat="server"></asp:Label></div>
    </form>
</body>
</html>



Please note:
1) The destination path for uploaded files should look like "D:\\home\\Username\\Htdocs\\Uploads\\"
2) Application pool user needs to be given Full Control access to that folder.


For more information, please refer to the MSDN site:
http://msdn.microsoft.com/en-us/library/aa479405.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload(VS.80).aspx