if (FileUploadControl.HasFile)
{
try
{
if (FileUploadControl.PostedFile.ContentType == "My Documents")
{
if (FileUploadControl.PostedFile.ContentLength < 102400)
{
string filename = Path.GetFileName(FileUploadControl.FileName);
FileUploadControl.SaveAs(Server.MapPath("C:\\Documents and Settings\\azhar\\My Documents\\flashrecorder.xml") + filename);
Label1.Text = "Upload status: File uploaded!";
Response.Redirect(Server.MapPath("C:\\Documents and Settings\\azhar\\My Documents\\flashrecorder.xml
" }
else
Label1.Text = "Upload status: The file has to be less than 100 kb!";
}
else
Label1.Text = "Upload status: Files are accepted!";
}
catch (Exception ex)
{
Label1.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}