in reply to Odd behavior of file test

You are testing for a file on the filesystem in /music/data/ but a webserver is not a filesystem and is typically configured to serve files from relative locations so when you go to request http://localhost/music/data/ the path is being resolved/normalized to the webroot and ends up /Users/user/Documents/httpd/public/local/music/data/. You need to copy the files into that path or add a symbolic link or adjust your apache config.

Replies are listed 'Best First'.
Re^2: Odd behavior of file test
by Trudge (Acolyte) on Oct 04, 2017 at 16:59 UTC

    I believe you have it. I changed my request to

    if (-e "/Users/user/Documents/httpd/public/local/music/data/$ArtistNam +e/$cdTitle/$Cover") { print qq{<p><img src="/music/data/$ArtistName/$cdTitle/$Cover" alt="$A +rtistName-$cdTitle" style="height:240px;width:240px;padding-right:100 +px;float:right"><br clear="right"/></p>}; }

    So I need a full system path in my test, but I can use the Apache path to do the print statement (which does show me the image).

    Many thanks for the solution and hopefully others will benefit as well.