Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2011
    Thanked 0 Times in 0 Posts

    image src problem when referencing folder above document root

    Not sure if this is strictly a HTML question but it seemed the most appropriate place to start the thread.

    I have a file, example.php and I'm trying to display an image inside this file. The image is stored in a folder called uploads which is outside the document root for security purposes.

    So to reference the file I try..

    img src="../uploads/image.jpg"

    this would strike me as the answer, and this works on WAMP. However it doesn't work on my webserver.

    Been messing around with this for about an hour now, any reasons why this doesn't work? and how should I work around this?

    Many thanks in advance, Chris

  • #2
    Senior Coder
    Join Date
    Aug 2010
    High Point, NC
    Thanked 363 Times in 360 Posts
    You have a link to your live site?

    It may be a permissions issue, or could be a filepath issue once the files are on the remote server.


    Posting Permissions

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