IIS ASP - problem using FileSystemObject

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > August 2004 > problem using FileSystemObject





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author problem using FileSystemObject
gadya

2004-08-25, 5:58 pm

I am learning to use ASP on IIS 6 under Windows XP.
When I came to the FileSystemObject I found IIS hangs on OpenTextFile.
(no problem when scripting on the Client!)
I couldn't find anything on Technet.

I find that I can use folderExists
but not getFolder

I can use GetFileName
but not GetFile
and not OpenTextFile

(I've tried using Fat32 and NTFS and different drive letters but to no avail.
I've turned off Norton antivirus and set my IE security settings to Low.)

I'm using the Script Debugger and executing one command at a time and it
hangs consistently on binding to a file.
I then have to reboot my PC in order to be able to use IIS.
------------------------

This works:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Stop
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FolderExists("H:\Downloads") then
Response.Write("<br>There is a folder named \Downloads")
End if

fln = fso.GetFileName("H:\Downloads\test.txt")
Response.Write(fln & "<br>")

</SCRIPT>

(The Stop is to activate the Debugger)
---------------------------------------

These don't work
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Stop
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FolderExists("H:\Downloads") then
Response.Write("<br>There is a folder named \Downloads")
set objFolder = fso.getFolder ("H:\Downloads")
' fails here
Response.Write("<br>Have bound to folder named \Downloads")
End if
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Stop
Set fso = Server.CreateObject("Scripting.FileSystemObject")

fln = fso.GetFileName("H:\Downloads\test.txt")
Response.Write(fln & "<br>")

set objFile = fso.GetFile ("H:\Downloads\test.txt")

' fails here
Response.Write("<br>Have bound to file named test.txt")

</SCRIPT>
--------------------------------

Any ideas?


Victor


Aaron [SQL Server MVP]

2004-08-25, 5:58 pm

http://www.aspfaq.com/2180

--
http://www.aspfaq.com/
(Reverse address to reply.)




"gadya" <gadya@discussions.microsoft.com> wrote in message
news:9F751265-4FAE-4416-B574-10D875AC3775@microsoft.com...
> I am learning to use ASP on IIS 6 under Windows XP.
> When I came to the FileSystemObject I found IIS hangs on OpenTextFile.
> (no problem when scripting on the Client!)
> I couldn't find anything on Technet.
>
> I find that I can use folderExists
> but not getFolder
>
> I can use GetFileName
> but not GetFile
> and not OpenTextFile
>
> (I've tried using Fat32 and NTFS and different drive letters but to no

avail.
> I've turned off Norton antivirus and set my IE security settings to Low.)
>
> I'm using the Script Debugger and executing one command at a time and it
> hangs consistently on binding to a file.
> I then have to reboot my PC in order to be able to use IIS.
> ------------------------
>
> This works:
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
> Stop
> Set fso = Server.CreateObject("Scripting.FileSystemObject")
> If fso.FolderExists("H:\Downloads") then
> Response.Write("<br>There is a folder named \Downloads")
> End if
>
> fln = fso.GetFileName("H:\Downloads\test.txt")
> Response.Write(fln & "<br>")
>
> </SCRIPT>
>
> (The Stop is to activate the Debugger)
> ---------------------------------------
>
> These don't work
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
> Stop
> Set fso = Server.CreateObject("Scripting.FileSystemObject")
> If fso.FolderExists("H:\Downloads") then
> Response.Write("<br>There is a folder named \Downloads")
> set objFolder = fso.getFolder ("H:\Downloads")
> ' fails here
> Response.Write("<br>Have bound to folder named \Downloads")
> End if
> </SCRIPT>
>
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
> Stop
> Set fso = Server.CreateObject("Scripting.FileSystemObject")
>
> fln = fso.GetFileName("H:\Downloads\test.txt")
> Response.Write(fln & "<br>")
>
> set objFile = fso.GetFile ("H:\Downloads\test.txt")
>
> ' fails here
> Response.Write("<br>Have bound to file named test.txt")
>
> </SCRIPT>
> --------------------------------
>
> Any ideas?
>
>
> Victor
>
>



gadya

2004-08-25, 5:58 pm

Thanks AAron

"Aaron [SQL Server MVP]" wrote:

> http://www.aspfaq.com/2180
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "gadya" <gadya@discussions.microsoft.com> wrote in message
> news:9F751265-4FAE-4416-B574-10D875AC3775@microsoft.com...
> avail.
>
>
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com