Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem deleting files from server... ObjFSO delete problem...

Status
Not open for further replies.

aspnewbee

MIS
Jul 11, 2004
34
US
Hi All... I'm trying to delete files from the server and its not working. Can any one help please?
It says the file doesn't exist... where as the file exists...
I did a response.write for my delFile to make sure its there but it doesn't see the file...



Thanks

A.



Code:
Dim fso
'Dim pathEnd
Dim MyFile
Dim delFile
Set fso = Server.CreateObject("Scripting.FileSystemObject")
FilePath = "C:\Inetpub\[URL unfurl="true"]wwwroot\conferences\upload\"[/URL]
MyFile = rsD.Fields.Item("docFile").Value
delFile= Filepath+MyFile
Response.Write delFile
If(fso.FileExists(FilePath)) Then
fso.DeleteFile(FilePath)
Else
Response.write("File Doesn't Exist")
End If
 
try changing the if/else statement to

If(fso.FileExists(delFile)) Then
fso.DeleteFile(delFile)
Else
Response.write("File Doesn't Exist")
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top