时间:2021-07-01 10:21:17 帮助过:5人阅读
代码如下:
switch($_FILES[$field]['error']) {
case 1:
// 文件大小超出了服务器的空间大小
$this->setError("The file is too large (server).");
break;
case 2:
// 要上传的文件大小超出浏览器限制
$this->setError("The file is too large (form).");
break;
case 3:
// 文件仅部分被上传
$this->setError("The file was only partially uploaded.");
break;
case 4:
// 没有找到要上传的文件
$this->setError("No file was uploaded.");
break;
case 5:
// 服务器临时文件夹丢失
$this->setError("The servers temporary folder is missing.");
break;
case 6:
// 文件写入到临时文件夹出错
$this->setError("Failed to write to the temporary folder.");
break;
}
http://www.bkjia.com/PHPjc/728100.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/728100.htmlTechArticle$_FILES['file']['error']值 UPLOAD_ERR_OK: 0 //正常,上传成功 UPLOAD_ERR_INI_SIZE: 1 //上传文件大小超过服务器允许上传的最大值,php.ini中设置upload_max_...