Check file exists in folder

Session[“profileFilePath”] = “~/Files/Profiles/”

string fileName = Path.GetFileName(FileUploadFilePath.PostedFile.FileName);
string uploadPath = Server.MapPath(string.Format(Convert.ToString(Session[“profileFilePath”]), fileName));

if (File.Exists(uploadPath + fileName))
{
ScriptManager.RegisterStartupScript(this, this.GetType(), “alert”, “window.scroll(0, 0);alert(‘File already exists’); “, true);
return;
}