jrthor2
08-10-2007, 10:51 AM
I have the below that deletes a file on the server. If the file is not there though, I get an error. How would I only delete the file if it is on the server?
if (Trim(Request.Form("link")) <> "") then
strPath = "/free_offerings/images/pdf/"
Filetodelete=server.mappath(Request.Form("link"))
'response.write("deleting file " & Filetodelete)
Set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFile(Filetodelete)
Set fs=nothing
end if
Thanks
if (Trim(Request.Form("link")) <> "") then
strPath = "/free_offerings/images/pdf/"
Filetodelete=server.mappath(Request.Form("link"))
'response.write("deleting file " & Filetodelete)
Set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFile(Filetodelete)
Set fs=nothing
end if
Thanks