Using FSO GetFolder method with Virtual Directory

Results 1 to 4 of 4

Thread: Using FSO GetFolder method with Virtual Directory

  1. #1
    JudyG. Guest

    Default Using FSO GetFolder method with Virtual Directory

    I&#039ll try to be brief...I&#039m working on an intranet. I have set up a remote virtual directory, and am trying to read the directory/file structure beneath it using the FSO Folder Object&#039s methods and properties. I know the FSO code is correct, but there is something not working with the connection portion. On my asp page that resides on the server, I call on the virtual directory by the following:<BR><BR>VDViewPath = "../../../VD/public files/"<BR>VDMapPath = server.mappath("/VD") & "public files\"<BR><BR>Dim fs, f, f1, foldername, sf, subf, subf1, subfoldername, subsf<BR> Set fs = CreateObject("Scripting.FileSystemObject")<BR> Set f = fs.GetFolder(VDMapPath)<BR> Set sf = f.SubFolders<BR>etc...<BR><BR>I get a "Path not found" error on the GetFolder line.<BR><BR>BUT, if I have previously logged into the remote PC through the browser (so the connection username/pw are in memory) then run my asp page, it runs like a charm.<BR><BR>Do I need to send the username/pw through - I thought the Virtual Directory used the "connect as" username/pw assigned without a prompt?! What am I missing? Any help would be GREATLY appreciated.<BR>JudyG

  2. #2 Guest

    Default RE: Using FSO GetFolder method with Virtual Direct

    Are you sure about the relative path to the VD folder. As you have stated it, you go down three levels of folders before you get to it. This seems a bit tricky to get right. You would be much better to try the root absolute path. <BR><BR>However if you must use the doc-relative scheme, then there is a good way to make sure of your relative path. If you are using a visual tool such as interdev, then open your asp page in the editor. Then drag and drop the VD folder onto the page. This will create a link "&#060;a href&#039..." tag. You should then be able to extract the exact virtual path from the link.

  3. #3
    JudyG Guest

    Default RE: Using FSO GetFolder method with Virtual Direct

    I am absolutely sure of the path. It works perfect when the following happens.<BR><BR>When I call on a test default.htm page placed in the Virtual Dir I am prompted for a username/password. I enter the u/p assigned in the "connect as" property when I set up the Virtual Dir and it takes me to the test page. I can go "back", choose my asp page with the noted code, and it works.<BR><BR>It looks like a connection/permission issue, but I read that Virtual Dirs do not rely on the permission authentication - they use the "connect as" variable only. Is this correct?<BR><BR>Any other suggestions?<BR>JudyG.

  4. #4
    mark Guest

    Default RE: Using FSO GetFolder method with Virtual Direct

    JudyG Hope you don&#039t mind, I&#039m new to ASP and have been trying to do something similar but have only been able to list the files from one folder not the sub folders in the directory using FSO, would you mind letting me have the code you used. I have been trying for a while to solve this but haven&#039t done yet. My email is <BR><BR>Your help in this would be greatly appreciated.

Posting Permissions

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