尝试上传图像文件时,托管服务器有时会发出警告。如果我尝试在成功尝试中上传相同的文件,图像将被上传。
警告:
Warning (2): move_uploaded_file(files/photos/3.jpg) [http://php.net/function.move-uploaded-file]: failed to open stream: Permission denied [APP/controllers/components/file_upload.php, line 55]
Warning (2): move_uploaded_file() [http://php.net/function.move-uploaded-file]: Unable to move '/tmp/phpUutr9Z' to 'files/photos/3.jpg' [APP/controllers/components/file_upload.php, line 55]
上传文件
if ( is_uploaded_file($file_temp) ) {
if (move_uploaded_file($file_temp, $destination . $filename . '.' . $extension)) {
$error = "SUCCESS";
return $error;
} else {
$error = "ERROR";
return $error;
}
}
此处,当警告出现时,其他部分中的“错误”也会返回警告...
我怎样才能纠正它?
它在本地服务器上运行良好......