SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Member SlicerX's Avatar
    Join Date
    Dec 2004
    Location
    Australia
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with setting up a default media dir.

    Hi,

    This is probably (well hopefully) an easy one:

    All I want to do is set a session variable in my default page which points to a directory on my server where all media for my site is contained. Now, I used a session variable to do this, and fell into a trap. Say I set it up like this: Session("mediadir")="D:\dev\<sitename>\media\". Now, when anyone looks at my site, the mediadir variable is trying to point to their d:\dev\.... What should I do. I know it is crazy, but I have mental blank.

    Thank you.

    --Steve

  2. #2
    SitePoint Enthusiast afgmail's Avatar
    Join Date
    Jan 2005
    Location
    Houston, TX
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SlicerX
    Session("mediadir")="D:\dev\<sitename>\media\"
    Should this be:
    Code:
    Session("mediadir")="http://www.yoursite.com/media/"
    Scan completed....
    Brain not found.
    filecabin.com : Notepad2

  3. #3
    SitePoint Member SlicerX's Avatar
    Join Date
    Dec 2004
    Location
    Australia
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think that is right! It may be, but I would not be able to point to a directory outside of IIS then.

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Session("mediadir") = Server.MapPath("/") & "\media\"

    Where Server.MapPath("/") is the physical location of the root of your website.

  5. #5
    SitePoint Enthusiast afgmail's Avatar
    Join Date
    Jan 2005
    Location
    Houston, TX
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like Jim is right here.....
    Scan completed....
    Brain not found.
    filecabin.com : Notepad2

  6. #6
    SitePoint Member SlicerX's Avatar
    Join Date
    Dec 2004
    Location
    Australia
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, great help!!!!

  7. #7
    SitePoint Member SlicerX's Avatar
    Join Date
    Dec 2004
    Location
    Australia
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhh, no, that did not work either. I thought it did, but when I tested it from another computer, the images did not display. Again, I think it was trying to find that path locally, not from the server. Hmm, this is silly, but I know there is an answer.... What am I doing wrong?


Bookmarks

Posting Permissions

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