Author: Tapas Bose | Posted on: 10/13/2010 8:43:47 AM | Views : 288

Hello everybody.
I am passing a file name via query string. When I am trying to delete the file it is throwing a FileNotFoundException. But the file practically deleted from the server. Both of the following codes of file delete :

File.Delete(Server.MapPath("~/Files/") + Request.QueryString["FileName"]); And File.Delete(Server.MapPath("~/Files/" + Request.QueryString["FileName"]));

are throwing that exception.
Can any one please tell me what is the reason behind this behavior or what I am doing wrong?
Thank you.

...

Go to the complete details ...