$file = request()->file('');
if(!empty($file)){
$info = $file['pphoto']->validate([
'size' => 1567800000,
'ext' => 'jpg,png,gif,jpeg',
])->move('uploads');
if ($info) {
$newData['pphoto'] = "uploads\\" . $info->getSaveName();
} else {
_alert_back($file->getError());
}
}
需要这样写 $info = $file['pphoto'] 才不会报 文件未上传
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号