$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'] 才不会报 文件未上传
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!