Server.Mappath Help

Discussion in 'ASP General' started by Y2K, Jun 26, 2006.

  1. Y2K

    Y2K Guest

    I have a thumbnail viewer which displays images on a webpage.
    Currently, the images reside in a subfolder of the root, and this works
    fine. I understand the main problem here is my limited knowlege of
    ASP.

    Here's the current setup:
    c:\testproj\imageviewer = Virtual directory named "IMGviewer"
    c:\testproj\imageview\upload\pics = folder that contains images


    The following code works:
    ImageConn = "pics/"
    Set fso = CreateObject("Scripting.FileSystemObject")
    'Set fattributes = fso.GetFolder(server.mappath(""&ImageConn&""))


    The problem is, the images are in another folder:
    c:\testfolder\myimages\pics_5


    I've tried the following, and get a "path not found" error.
    Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5\")
    Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5")
    Set fattributes =
    fso.GetFolder("//servername/c$/testfolder/myimages/pics_5")
    Set fattributes =
    fso.GetFolder("//servername/c$/testfolder/myimages/pics_5/")


    Can anyone tell me what I'm doing wrong? Thanks.


    Y2K
     
    Y2K, Jun 26, 2006
    #1
    1. Advertising

  2. Y2K

    Jeff Cochran Guest

    On Mon, 26 Jun 2006 15:28:02 -0700, Y2K
    <> wrote:

    >I have a thumbnail viewer which displays images on a webpage.
    >Currently, the images reside in a subfolder of the root, and this works
    >fine. I understand the main problem here is my limited knowlege of
    >ASP.
    >
    >Here's the current setup:
    >c:\testproj\imageviewer = Virtual directory named "IMGviewer"
    >c:\testproj\imageview\upload\pics = folder that contains images
    >
    >
    >The following code works:
    >ImageConn = "pics/"
    >Set fso = CreateObject("Scripting.FileSystemObject")
    >'Set fattributes = fso.GetFolder(server.mappath(""&ImageConn&""))
    >
    >
    >The problem is, the images are in another folder:
    >c:\testfolder\myimages\pics_5
    >
    >
    >I've tried the following, and get a "path not found" error.
    >Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5\")
    >Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5")
    >Set fattributes =
    >fso.GetFolder("//servername/c$/testfolder/myimages/pics_5")
    >Set fattributes =
    >fso.GetFolder("//servername/c$/testfolder/myimages/pics_5/")
    >
    >
    >Can anyone tell me what I'm doing wrong?


    Trying to access a folder with an incorrect path. :)

    Most likely the folder in question doesn't have permission for the
    account accessing it.

    Jeff
     
    Jeff Cochran, Jun 27, 2006
    #2
    1. Advertising

  3. Y2K

    Y2K Guest

    "Jeff Cochran" wrote:

    > On Mon, 26 Jun 2006 15:28:02 -0700, Y2K
    > <> wrote:
    >
    > >I have a thumbnail viewer which displays images on a webpage.
    > >Currently, the images reside in a subfolder of the root, and this works
    > >fine. I understand the main problem here is my limited knowledge of
    > >ASP.
    > >
    > >Here's the current setup:
    > >c:\testproj\imageviewer = Virtual directory named "IMGviewer"
    > >c:\testproj\imageview\upload\pics = folder that contains images
    > >
    > >
    > >The following code works:
    > >ImageConn = "pics/"
    > >Set fso = CreateObject("Scripting.FileSystemObject")
    > >'Set fattributes = fso.GetFolder(server.mappath(""&ImageConn&""))
    > >
    > >
    > >The problem is, the images are in another folder:
    > >c:\testfolder\myimages\pics_5
    > >
    > >
    > >I've tried the following, and get a "path not found" error.
    > >Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5\")
    > >Set fattributes = fso.GetFolder("c:\testfolder\myimages\pics_5")
    > >Set fattributes =
    > >fso.GetFolder("//servername/c$/testfolder/myimages/pics_5")
    > >Set fattributes =
    > >fso.GetFolder("//servername/c$/testfolder/myimages/pics_5/")
    > >
    > >
    > >Can anyone tell me what I'm doing wrong?

    >
    > Trying to access a folder with an incorrect path. :)
    >
    > Most likely the folder in question doesn't have permission for the
    > account accessing it.
    >
    > Jeff
    >


    Ok.. not having permissions is fine.. I can fix that. What's the correct
    path? Are you saying I'm getting that error because the path cannot be found
    due to insufficient permissions?

    Y2k
     
    Y2K, Jun 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,368
    Scott M.
    Jan 17, 2010
  2. Peter Row
    Replies:
    0
    Views:
    490
    Peter Row
    Mar 1, 2004
  3. =?Utf-8?B?dHBhcmtzNjk=?=

    server.mappath vs. request.mappath

    =?Utf-8?B?dHBhcmtzNjk=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,227
    Juan T. Llibre
    Mar 11, 2007
  4. Replies:
    4
    Views:
    1,008
    Juan T. Llibre
    Oct 7, 2007
  5. AAaron123
    Replies:
    11
    Views:
    1,221
    AAaron123
    Sep 9, 2009
Loading...

Share This Page