<form action="index.php/upload/up" enctype="multipart/form-data" method="post">
<input type="file" name="remPz[]" >
<input type="file" name="remPz[]" >
<input type="file" name="remPz[]" >
<button id="test" >Click Me!</button>
</form>$inf = $upload->upload(array($_FILES['remPz']));
$config = array(
'rootPath' => './public/', //根目录
'savePath' => $savePath, //保存路径
'maxSize' => 3292200,//最多上传文件大小
'allowExts' => explode(',', 'jpg,gif,png,jpeg')//上传文件格式
);
$upload = new \Think\Upload($config);
$inf = $upload->upload(array($_FILES['remPz']));
if(!$inf){
$this->errorJson($upload->getError());
}else{
for($i=0;$i<count($inf);$i++){
$arr[] = $inf[$i]['savepath'].$inf[$i]['savename'];
}
$this->successJson($arr);
} 最佳答案