警告:move_uploaded_file(/home/site/public_html/wp-content/themes/mytheme/upgrader.zip)[function.move-uploaded-file]:無法打開流:權限在/ home/site/public_html/wp-content/themes/mytheme/uploader.php on line 79什麼是導致此權限的錯誤,我該如何解決它?
Warning:move_uploaded_file()[function.move-uploaded-file]:無法將'/ tmp/phptempfile'移動到'/ home/site/public_html /wp-content/themes/mytheme/upgrader.zip'在線79 /home/site/public_html/wp-content/themes/mytheme/uploader.php有問題。抱歉!
代碼低於該行...
// permission settings for newly created folders
$chmod = 0755;
// Ensures that the correct file was chosen
$accepted_types = array('application/zip',
'application/x-zip-compressed',
'multipart/x-zip',
'application/s-compressed');
foreach($accepted_types as $mime_type) {
if($mime_type == $type)
{
$okay = true;
break;
}
}
$okay = strtolower($name[1]) == 'zip' ? true: false;
if(!$okay) {
die("This upgrader requires a zip file. Please make sure your file is a valid zip file with a .zip extension");
}
//mkdir($target);
$saved_file_location = $target . $filename;
//Next line is 79
if(move_uploaded_file($source, $saved_file_location)) {
openZip($saved_file_location);
} else {
die("There was a problem. Sorry!");
}
只是觀察:您檢查上傳文件的MIME類型,然後用$'$ = = strtolower($ name [1])=='zip'這行來丟棄檢查結果? true:false;' – Dancrumb 2010-03-19 14:52:15