one doubt about asyncfileupload complete

Posted by reddysankark-13471 under ASP.NET on 10/22/2012 | Points: 10 | Views : 888 | Status : [Member] | Replies : 0
hi,
if i got any error while inserting file.it will show file not inserted.but the image was saved in folder not in server. how to prevent this
my coding will be this


string Filename,FilePath;
int status;

Filename=AsyncFileUpload1.FileName;
FilePath = "~/Images/" + Filename;
AsyncFileUpload1.SaveAs(MapPath(FilePath));

try
{
status = FileUpload.Upload1(Filename,FilePath);
if (status >= 1)
{

//Response.Redirect("~/FileUpload/login.aspx");
Label1.Text = "File inserted";
}
else
{
Label1.Text = "File not inserted";

}

}
catch(Exception ex)
{
throw ex;
}
}

sankarreddy


Responses

(No response found.)

Login to post response