thinkphp3.2给layui写的上传接口 3145728,//文件上传的最大文件大小(以字节为单位),0为不限大小// 'savePath' = '/Content/', 'rootPath' = 'Upload/Content/', //保存根路径 'saveName' = array('uniqid',''), 'ext
3145728,//文件上传的最大文件大小(以字节为单位),0为不限大小 // 'savePath' => '/Content/', 'rootPath' => 'Upload/Content/', //保存根路径 'saveName' => array('uniqid',''), 'exts' => array('jpg', 'gif', 'png', 'jpeg'), 'autoSub' => true, 'subName' => array('date','Ymd'), ); $upload=new Upload($config); $info=$upload->upload(); if ($info){ foreach($info as $file){ $data['src']="/".$config['rootPath'].$file['savepath'].$file['savename']; } $this->toApi('0',"上传成功",$data); }else{ $this->toApi('1',$upload->getError()); } } }