In this sample, I'm assuming that you are using a FileUpload button on the page. The code takes into account the fact that the user could upload a document with the same name as one that already exists.
private void StoreUploadedFile()
{
if (!fileUpload.HasFile)
{
return;
}
string path = Server.MapPath(string.Format("~/Resumes/{0}", Guid.NewGUID()));
fileUpload.SaveAs(path);
if (!SaveFileInformation(fileUpload.FileName, path))
{
File.Delete(path);
}
}
I haven't included the code to save the file to the database - I'm assuming you know how to write that code yourself. There are a few things to note; you need to store the original filename, along with the path to the modified filename. Secondly, if you don't succeed in writing to the database, you should remove the file that was uploaded. Finally, this code relies on you having the appopriate privileges to write to the Resumes directory.
The sample I have provided has no error handling built into it. You should consider adding this to the code. What I have provided is a sample that I knocked up in the CP editor; it is not production ready code.