|
 |
asp_web_howto thread: FileObjectSystem not working
Message #1 by "Kalle Hiitola" <nerd112@j...> on Thu, 20 Feb 2003 12:44:52
|
|
I have a problem with using FileObjectSystem. The following doesn't seem
to work. There is no error message it only looks like the code it stuck in
infinite loop or something like that. If I only try to create
FileObjectSystem it works fine. I can use the FileExists method too. But I
can't use any of the other methods. If there is another way to delete
files than FileObjectSystem it would be nice to know, because I could give
them a try. Unfortunetly I can't use ASP.NET in this server so that out of
options. Here is the code:
'DELETING FILES
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
On Error Resume Next
file = server.MapPath("readme.txt")
if fso.FileExists(file) then
call fso.DeleteFile(file, True)
end if
If Err.Number = 0 Then
Response.Write "File Deleted"
Else
Response.Write Err.Description
End If
Set fso = Nothing
Please help me.. I'm in terrible hurry too :(
Message #2 by Imar Spaanjaars <Imar@S...> on Thu, 20 Feb 2003 13:41:16 +0100
|
|
Let me guess, you have Norton Anti Virus installed on the server, right??
If so, disable its Script Blocking feature through the Options dialog.
HtH
Imar
At 12:44 PM 2/20/2003 +0000, you wrote:
>I have a problem with using FileObjectSystem. The following doesn't seem
>to work. There is no error message it only looks like the code it stuck in
>infinite loop or something like that. If I only try to create
>FileObjectSystem it works fine. I can use the FileExists method too. But I
>can't use any of the other methods. If there is another way to delete
>files than FileObjectSystem it would be nice to know, because I could give
>them a try. Unfortunetly I can't use ASP.NET in this server so that out of
>options. Here is the code:
>
>'DELETING FILES
>Dim fso
>Set fso = Server.CreateObject("Scripting.FileSystemObject")
>On Error Resume Next
>file = server.MapPath("readme.txt")
>if fso.FileExists(file) then
>call fso.DeleteFile(file, True)
>end if
>If Err.Number = 0 Then
>Response.Write "File Deleted"
>Else
>Response.Write Err.Description
>End If
>Set fso = Nothing
>
>Please help me.. I'm in terrible hurry too :(
|
|
 |