I have my site structure as follows:
mysite.co.uk/admin/file.php
my images are stored:
mysite.co.uk/files/images/product/
The problem I am facing is the the code on the
mysite.co.uk/admin/file.php will not let me read the images in the products folder:
My code is as follows:
$dir = "../files/images/product/";
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
foreach ($files as $filename){
echo "<option value='". $filename . "'>" . $filename . "</option>";
}
Please any advise is welcome
I can see the files stored in ../files/images/ when changing the $dir to ../files/images/product the server send a HTTP502 error, which seems a bad gateway.
I have tried to allow url files/images/product in the firewall however that doesnt work either.
I have also tried to change the permission on the actual folder 0755 to 0644 but that caused a lot more problems
The server is godaddy.
Please any advise is welcome