Many of my image files are uppercase while the others are lower case. I wrote a page that will look in the directory and copy the images from to a directory called "lower". I checked the permissions and all groups and users have read/write permissions. There isn't a problem listing the files but it wouldn't copy them. Below is the code and then the error messages.
Any insight will be appreciated.
//script code
<?php
$dir = "/home/virtual/site26/fst/var/www/html/members/images/family";
$handle = opendir($dir) or die("Couldn't open the directory");
if(is_dir($dir))
{
while(false !== ($files = readdir($handle)))
{
if($files != "." && $files != ".." && $files != "thumbnails")
{
$dirArray[] = $files;
while(list(,$image) = each($dirArray))
{
// echo strtolower($image)."<br>\n";
if(!copy($image, "lower/.strtolower($image)))
{
echo "Copy failed";
}//end if
}
}
}
}
?>
//end script
//error message
Warning: copy(FAMILY01.JPG) [function.copy]: failed to create stream: No such file or directory in /home/virtual/site26/fst/var/www/html/dir.php on line 17
Copy failed