getFile() and getFolder() execution problem

Discussion in 'Classic ASP' started by PGScannell, Mar 24, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a laptop (named LAPTOP) with Windows 2000 PRO running IIS. There are a few intranet sites loaded on this laptop.

    I have a problem. If I execute either the getFolder() or getFile() methods from the file system object, they never return --- no error message, nothing.

    I have verified that the security on all the folders within the environment have read & write permissions for LAPTOP\IUSR_LAPTOP.

    Here's a snibblet of code that should work. As soon as the objFolder.getFolder() is executed, the app just runs indefinitely.

    (BTW, this code works flawlessly on my desktop's version of this site.)

    Set objFSO = Server.CreateObject ( "Scripting.FileSystemObject" )
    Set objFOLDER = objFSO.getFolder ( "c:\inetpub\wwwroot\xxxx\Councils" )
    Set objFILES = objFOLDER.Files

    for each strFileName in objFILES
    response.write strFileName.Name & "<BR>" & vbCrLf
    next

    response.end
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Are you saying you tried to run the above code snippet on our server?

    I don't think it will work because the path does not exist on our server.
     
  3. Hi,
    If you want I can give you the code I wrote for the FSO tool here: http://sdknuts.net/akgsrch.asp
    (That's a site I donated to a College in Canada.)
    All the best,
    Mark
     
  4. The purpose of the code snibbet is to show you which function call failed. The actual value of the path will be different on every website you run it on. it's the problem with executing the getFolder() and getFile() that needs to be addressed.

    Thanks,
    paul
     
  5. Hi,
    Look in your sites Control Panel and you can find the site path.
    Then use it like this:
    Set objFolder = objFSO.GetFolder("e:\web\yoursite\htdocs\Councils\")
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    i used the exact same code you posted (with the correct path) on my test site. I worked fine.

    What error is the code producing?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page