HI All,
I have ollowing code to delete the image by using File.Delete(fileNamefordel + ".jpg"); function. It works fine on local server but not on uploaded server.
string fileNamefordel = Server.MapPath("StdImage") + "\\" + (Session["lCandidateID"]).ToString();
if (File.Exists(fileNamefordel + ".png")) { File.Delete(fileNamefordel + ".png"); }
if (File.Exists(fileNamefordel + ".gif")) { File.Delete(fileNamefordel + ".gif"); }
if (File.Exists(fileNamefordel + ".jpg")) { File.Delete(fileNamefordel + ".jpg"); }
if (File.Exists(fileNamefordel + ".jpeg")) { File.Delete(fileNamefordel + ".jpeg"); }
if (File.Exists(fileNamefordel + ".tif")) { File.Delete(fileNamefordel + ".tif"); }
Please if anybody helps in this regard.
Thanks
Shakeel