if ($_FILES['user_pic']['error']<4) { $cfg=array('rootPath' =>'Public/uploads/' , );//最高级的public $up= new\Think\Upload($cfg); $z = $up-> uploadOne($_FILES['user_pic']); $uil = $up->rootPath.$z['savepath'].$z['savename']; $small_uil = $up->rootPath.$z['savepath'].'small_'.$z['savename']; $im = new\Think\Image(); $im->open($uil); $im->thumb(100,100); $im->save($small_uil); dump($up); } else { # code... }