html help on osx file system question

Discussion in 'Mac Help/Tips' started by purduematt, May 4, 2003.

  1. purduematt macrumors newbie

    Joined:
    Jul 17, 2002
    #1
    i have a few webpages located in the folder:

    /users/matt/sites/folder1/

    and would like to use a picture from the foler

    /users/matt/sites/images/

    i have tried the following with no luck:

    <img src="/images/picture.gif">

    and

    <img src="../images/picture.gif">

    could somebody tell me what i am doing wrong? i think it isprobably something simple, i just couldn't figure it out. thanks,

    matt
     
  2. GeeYouEye macrumors 68000

    GeeYouEye

    Joined:
    Dec 9, 2001
    Location:
    State of Denial
    #2
    I don't know the right answer, but you could put an alias to the pictures you want to use in the sites folder and just access that. Just a thought.
     
  3. rainman::|:| macrumors 603

    rainman::|:|

    Joined:
    Feb 2, 2002
    Location:
    iowa
    #3
    Don't put the / in front of it. If you do, you're designating an absolute pathname which tells the computer where to look from the root level of your HD, not the current directory being used.

    pnw
     
  4. purduematt thread starter macrumors newbie

    Joined:
    Jul 17, 2002
    #4
    i thought that when you put / in it refered to the site root, not the absolute pathname from the computer. i may be wrong.

    i also tried

    <img src="/users/matt/sites/images/picture1.jpg">

    and

    <img src="images/picture1.jpg">

    with no luck

    i am not sure why this is not working. maybe i have to have the pictures in the same folder, or below the webpage in the file system
     
  5. Jimong5 macrumors 6502

    Joined:
    Jul 22, 2002
    #5

    try:
    <img src="/~matt/images/picture1.jpg">, and see how that works
     
  6. rainman::|:| macrumors 603

    rainman::|:|

    Joined:
    Feb 2, 2002
    Location:
    iowa
    #6
    Okay, it tells the server where to find the images thare are being accessed, on the server. Try this: Open the "Get Info" window on your Sites folder, open the Permissions tab, and click "copy to enclosed items" or whatever it is-- the Images folder may not be accessible in the same way as stuff in the Sites folder--

    it's hung me up once or twice...

    pnw
     
  7. Rower_CPU Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #7
    To use a relative path, use the "../" notation to go up a directory.

    For instance, when you're in a page within /Users/matt/Sites/folder1/ and you need to get back to /Users/matt/Sites/images/picture.gif, use the following code:
    PHP:
    <img src="../images/picture.gif">
    The path will go up one from "folder1" and then into "images" to get the file.

    [edit: Jimong5's code above should work, too.]
     
  8. purduematt thread starter macrumors newbie

    Joined:
    Jul 17, 2002
    #8
    thanks for the help everybody. it looks like it was a permissions problem. after performing paulwhannel's suggestion everything worked as normal.

    thanks again,

    matt
     

Share This Page