A
Anjan Bhowmik
Hi,
I use a form to upload an image to a directory on my site
(~/Images/UserName/file1.jpg). Using Server.mapPath function i get the
Physical path and save the file using
FileUpload1.PostedFile.SaveAs(filePath) function. The file is saved fine.
I also keep an daabase entry to store the virtual path
(~/Images/UserName/file1.jpg) for that specific user entry. The problem is
when i try to use File.Delete(Server.MapPath("~/Images/UserName/file1.jpg"))
to delete the file i get this error
I use a form to upload an image to a directory on my site
(~/Images/UserName/file1.jpg). Using Server.mapPath function i get the
Physical path and save the file using
FileUpload1.PostedFile.SaveAs(filePath) function. The file is saved fine.
I also keep an daabase entry to store the virtual path
(~/Images/UserName/file1.jpg) for that specific user entry. The problem is
when i try to use File.Delete(Server.MapPath("~/Images/UserName/file1.jpg"))
to delete the file i get this error