PHP Manaual chmod
http://php.net/manual/en/function.chmod.php
chmod("/somedir/somefile", 0755);
在上下文中;
$typepath = $_POST['filetype'];
$target_path = "../../images/uploads/".$typepath."/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
chmod($target_path, 0755);
echo "
The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded
\nTo the directory: ".substr($target_path, 6)."
";} else{
echo "There was an error uploading the file, please try again!";
}