private function savefiles($files,$student_id){
$config=[
'rootPath' => WORKING_PATH.FILES_UPLOAD_PATH, //保存根路径
'subName' => array('creatSubName',$student_id),
];
$upload = new Upload($config);
$upload-> subName = array('creatSubName',$student_id);
$uploadres = $upload->uploadOne($files);
if ($uploadres){
return $uploadres;
}else{
return false;
}
}
public function creatSubName($student_id){
dump("创建名字!");die;
return $student_id;
}这样写不进入creatSubName方法,不传入参数也是一样,求指教
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
目前暂时使用的upload 里面的savepath属性进行替代,能够达成效果
private function savefiles($files,$student_id){ $config=[ 'rootPath' => WORKING_PATH.FILES_UPLOAD_PATH, //保存根路径 'autoSub' => false, //自动子目录保存文件 'savePath' => $student_id.'/'.date('Y-m-d').'/', ]; $upload = new Upload($config); $uploadres = $upload->uploadOne($files); if ($uploadres){ return $uploadres; }else{ return false; } }