Hi guys,
Thanx for taking a look at this! Going crazy here...
I wrote a script (which works on my Apache under WinXP) to create a folder and then copy a list of images form another url into it. The folder is being created in a parent dir with chmod 777 and this works. But the files aren't copied into it. If I copy them to the parent dir they do get copied, any reason for this???
$dir = "copied_images/";
$tmpdirname = str_replace(".", "", $_SERVER['REMOTE_ADDR'].time());
if (!file_exists($dir.$tmpdirname))
{
$old = umask(0);
mkdir($dir.$tmpdirname,0777);
umask($old);
}
for($i=0;$i<count($photos) ;$i++)
{
if(strstr($photos[$i], "http://"))
{
$img = basename($photos[$i]);
copy($photos[$i], $dir.$tmpdirname.'/'.$img);
// works if I do:
//copy($photos[$i], $dir.$img);
}
}
Any clues???
Cheers