Hi guys i am try to copy already uploaded files from temp folder to newly created folder
$moveID = mysql_insert_id();
$movePath = "../media/events/".$moveID."/";
if (!file_exists($movePath)) {
mkdir($movePath,0777);
chmod($movePath,0777);
}
//----------------------------------//
$tempPath = "../temp";
if ($handle = opendir($tempPath)) {
while (false !== ($file1 = readdir($handle))) {
if ($file1 != "." && $file1 != "..") {
rename($tempPath."/".$file1, $movePath.$file1);
$del=unlink($tempPath."/".$file1);
}
}
closedir($handle);
}
If the folder is already created(exsistint on server) and has the chmod set to 777 it works fine. The files want copy over to the new folder if created using mkdir
Anyone?
Thanks