Access to Virtual Directory path using FileSystemObject and Server.MapPath fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbonifacejr
    New Member
    • May 2007
    • 1

    Access to Virtual Directory path using FileSystemObject and Server.MapPath fails

    I am unable to use the GetFolder method of the FileSystem object when
    trying to get the folders from within a Virtual Directory. Here is my
    setup...

    I have a Development Box (DB) and a WebServer (WS) and a separate file
    server (FS). On FS, I have a share with permission for Everyone set to
    Read. On my DevBox I have a website in IIS named CD and inside the
    website folder I have a Virtual Directory (Moozik) with the location
    set to \\FS\ShareName. All of this is on a home network, not a domain.


    When I run the following code, I am shown the error message "Exception
    from HRESULT: 0x800A004C (CTL_E_PATHNOTF OUND)"


    oFSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
    sPath = Server.MapPath( "Moozik\")
    fRoot = oFSO.GetFolder( sPath)


    This is the first time I have ever tried to use virtual directories. I
    do not know what kinds of permissions I need to set in IIS on the
    Virtual Directory. One thing I did try was to go in and change the
    IUSR_Servername anonymous account to ASPNET. I also checked the
    Integrated Windows Authentication checkbox. But, even when I did not
    have the Integrated Authentication box checked, I got the same error.


    One strange thing is that if I open a browser and navigate to "http://
    localhost/cdcosmos/Moozik/Gary Hoey/Animal Instinct/Texas Son.wma


    I am able to get the song to play in Media Player. So, it is obvious
    to me that IIS knows that the folders are there and is able to
    navigate them, but I don't know why I can't get the code to work.


    Any ideas? Do I need to create an entry of some kind in my .config file?
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    I don't believe that this is IIS problem. The problem appears to be with the server mapath location. HTH.

    Comment

    Working...