FileSystemObject is not responsive

Results 1 to 4 of 4

Thread: FileSystemObject is not responsive

  1. #1
    Jeff Swearingen Guest

    Default FileSystemObject is not responsive

    I&#039;m trying to do fairly simple things with the FSO: get a file&#039;s size and open a text file and read sections of text into variables.<BR><BR>I can declare the FileSystem object, but as soon as I do anything with it (i.e use GetFile or OpenTextFile) the browser acts as if it is still loading the page . I let it run for at least 5 minutes and nothing happens. It just sits there and continues to load.<BR><BR>The only FSO method that I can get to work is FileExists:<BR><BR>&#060;%<BR> dim fsObj, fsFile<BR><BR> set fsObj = Server.CreateObject("Scripting.FileSystemObject")< BR><BR> if fsObj.FileExists("c:filetest.txt") then<BR> response.write "the file is here"<BR> end if<BR>%&#062;<BR><BR>The page loads fine and displays "the file is here"<BR><BR>But if I try any other funciton like GetFile or OpenTextFile, the browser hangs:<BR><BR>&#060;%<BR> dim fsObj, fsFile<BR><BR> set fsObj = Server.CreateObject("Scripting.FileSystemObject")< BR><BR> if fsObj.FileExists("c:filetest.txt") then<BR> response.write "the file is here"<BR> set fsFile = fsObj.GetFile("c:filetest.txt")<BR> end if<BR>%&#062;<BR><BR>I have the scrrun.dll on my system (Windows 2000 Server, IIS 5.0) and I can perform the desired functions in a Windows VBScript file. But once I do it in ASP, I get nothing. IIS is set to its defaults. No special security options are setup.<BR><BR>Are there any system settings or prequisites that I need before using FSO? Any ideas? <BR><BR>Thanks,<BR>Jeff<BR>

  2. #2
    Join Date
    Dec 1969

    Default Since you haven't had other answers...

    It makes little sense to me. I *think* you need the same permissions to check for a file&#039;s existence as you do to read the file.<BR><BR>As for "special security": It&#039;s not a question of how IIS is set up; it&#039;s a question of whether the user IIS runs as is given permissions by the OS. But can Exists work and read not work?<BR><BR>I do note that the example you use ("c:filetest.txt") is not in the current virtual directory. <BR><BR>Have you tried it with a file that *is* in that directory? Maybe just try to dump out he ASP file itself?<BR><BR>**** someFile.asp *****<BR>&#060;HTML&#062;&#060;BODY&#062;<BR>&#060 ;%<BR>set fsObj = Server.CreateObject("Scripting.FileSystemObject")< BR>set fsFile = fsObj.OpenTextFile( Server.MapPath("someFile.asp") ) &#039; same file!<BR>%&#062;<BR>&#060;PRE&#062;<BR>&#060;% = fsFile.readAll %&#062;<BR>&#060;/PRE&#062;<BR><BR>&#060;/BODY&#062;&#060;/HTML&#062;<BR>************************************ <BR><BR>Does *that* make any difference?<BR><BR>If so, then I guess it is permissions, no matter what I may think (grin). If it doesn&#039;t work, then I&#039;d go try getting another copy of the scrrun.dll and installing it. Because obviously if the Web server can read the file for use by the ASP engine, it should be able to be read by the scrrun components. At least I would hope so.<BR><BR>

  3. #3
    Jeff Swearingen Guest

    Default RE: FileSystemObject is not responsive - SOLUTION

    [Solution also posted to ASP Q&A forum]<BR><BR>I found the solution.<BR><BR>If you have Frontpage 2000 Server Extensions installed (on Windows NT or 2000 Server) it modifies permissions on the inetpub/wwwroot/&#060;website name&#062; directory tree and adds 3 local user groups. Supposing a server called WEBSERVER, the groups would be WEBSERVER Admins, WEBSERVER Authors and WEBSERVER Browsers. <BR><BR>By default, in Windows 2000, these groups only have "List Folder Contents" access. The FileSystemObject requires more access than that. But when it&#039;s denied access because of these security changes, instead of displaying a message to the user it just hangs up.<BR><BR>If you modify the folder permissions for the WEBSERVER Browsers group and add "Read & Execute" and "Read" access rights, the FileSystemObject will work as intended.<BR><BR>Thanks to those of you who posted suggestions.<BR><BR>Jeff<BR>

  4. #4
    Jeff Swearingen Guest

    Default RE: Since you haven't had other answers...

    Thanks for the suggestion. As you can see from the solution I posted below, it had to do with permissions. Simple thing but turned out to be real tricky to track down. I was working on new version of another web-based application that we use and its documentation mentioned that the FP2000 Server Extensions can cause problems when an ASP application needs to read from or write to the filesystem.<BR><BR>Thanks again,<BR>Jeff<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts