I have my server set up and I can send images from the htdocs/images folder. However, I want to display images from outside of the htdocs folder.
In my httpd.conf file, I created an alias, so now /myimages links to the appropriate folder on my computer. If I navigate to localhost/myimages, I get the index of myimages and it displays a listing of all my images.
Whenever I directly access the file, say
$file = "myimages/image.jpg";
It works perfectly fine, I return the image as I expect. The problem comes in when I try to look for the image instead of directly accessing it.
Whenever I try to do:
$files = scandir($dir);
Where $dir is "images" or "myimages" it just returns an error message saying no such file or directory.
My intention is to set it up so that I can search for the file I wanted by some text input from the user and serve up the file. However, it seems to be a problem that it's an alias and not actually there.