To use File Upload Control you need 2 things:
1. The File Upload control itself (that's obvious).
2. A button control to trigger the file upload.
so you'll have let's say:
<asp:fileupload id="fileupload1" runat="server" xmlns:asp="#unknown" />
and also a button right next to it:
<asp:button id="btnUpload" text="upload" runat="server" xmlns:asp="#unknown" />
You'll need to add a "On Click" event to the button to actually take the file being posted.
Let's asume you already did that, and C# already has an on click event. Then you'll have to write something like
string FileToSave = fileupload1.FileName;
fileupload1.SaveAs(Server.MapPath("~/") + FileToSave);
I recommend you to create an additional folder to your project to store files uploaded.
Also, include an additional if statement to your c# in case someone tries to upload a file with the same name so you don't get an error as in...
if (File.Exists(Server.MapPath("~/") + FileToSave))
{
...save as another name
}
Additional caution would be to make sure the FileUploader has a file. Boolean property fileupload1.HasFile can be used for that.
You can also create a new name for the file using Math.Rand() or something.