Hi all,
this is real simple, I've written this code so I can duplicate images/files after uploading it with jumploader (this doesn't allow for duplicates during the upload process like standard upload handlers... sucks).
It does what it should do which is copy files from one directory to another but I get a error message "Warning: copy() [function.copy]: The first argument to copy() function cannot be a directory in /home/veresour/public_html/streammii.com/q/forTest.php on line 34"... is there a way to avoid this or atleast not display it?
-
$pathA = "user/aetienne/photos/aetienne853139394/tmp/l/";
-
$pathB = "user/aetienne/photos/aetienne853139394/tmp/t/";
-
// path to the directory to read ( ./ reads the dir this file is in)
-
if ($handle = opendir($pathA)) {
-
while (false !== ($file = readdir($handle))) {
-
if ($file != "." && $file != "..") {
-
if(!is_dir($file)){
-
$item[] = $file;
-
sort($item,SORT_REGULAR);
-
}
-
}
-
}
-
closedir($handle);
-
}
-
$total_items = count($item);
-
-
print_r($item);
-
-
echo '<br/>';
-
-
$total_items = count($item);
-
echo $total_items;
-
-
for($n=0; $n<=$total_items; $n++) {
-
$source = $pathA . $item[$n];
-
$destination = $pathB . $item[$n];
-
$thumbnailCopy = copy($source, $destination);
-
}
-