摘要:TP自己的上传类支持多图上传
//如果有直接传图片了,就保存图片
if($_FILES['myFile']['name'][0]){
$upload = new \Think\Upload();
$upload->maxSize = 3145728;
$upload->exts = array('jpg', 'gif', 'png', 'jpeg','docx','txt','xlsx','pdf','csv');
$upload->rootPath = './Uploads/';
$upload->savePath = '';
$upload->autoSub = false;
//$upload->saveName = array('img_name',array('__FILE__'));
// 上传文件
$info = $upload->upload();
if(!$info) {
$this->error($upload->getError());
}else{
foreach($info as $file){
$path_url[] = $file['savepath'].$file['savename'];
$old_db[] = $file['savename'];
}
}