I'm using this simple code to upload a picture to a directory in server, the problem I have is that the picture permissions when uploaded are not 664 but 660, it means it can be read by the public.
The directory is 777, so everything is ok, but why the picture is unreadable by defect and how can I change it?
Code: Select all
if(isset($image))
{
$target_path = "images/";
//$target_path = $target_path . basename( $_FILES['image']['name']);
$_FILES['image']['tmp_name'];
$newname=$ref.".jpg";
$target_pathandname = $target_path.$newname;
if(move_uploaded_file($_FILES['image']['tmp_name'], $target_pathandname)) {
echo "*** ok";
} else{
echo "***";
} }else{
echo "*** No ha subido";
}