Got the following code that is not actually transferring the image from the temp directory to the permanent directory. It creates the directory just fine, but it seems that it creates it with 0755 permissions regardless the mkdir() instructions.
function addPhotos($infoArr, $fileArr){
$qry="SELECT dir FROM tblphotogs WHERE id = ".$infoArr['photog'].";";
$rs=mysql_query($qry);
if($line=mysql_fetch_assoc($rs)){
$phDir = $line['dir'];
}else{
return(false);
exit;
}
$imgDir = "../images/".$phDir;
for($i=0; $i<count($fileArr); $i++){
if(is_uploaded_file($fileArr['tmp_name'][$i])){
if(!is_dir($imgDir)){
if(!mkdir($imgDir, 0777)){
return(false);
exit;
}
}
$imgTyp = getimagesize($fileArr['tmp_name'][$i]);
$flName = basename($fileArr['name'][$i]);
if($imgTyp[2] != 2){
return(false);
exit;
}else{
if(!move_uploaded_file($flName, $imgDir."/".$flName)){
print("didn't upload!");
return(false);
exit;
}else{
return(true);
}
}
}
}
}
The permissions on the main images directory is set to 077 as chmod is not allowed on this particular server. Anybody see what I've got wrong in the code? Been staring at it forever, it seesm, and can hardly see it by now...
Thanks in advance to anyone kind enough to take a look.