public function upload_report1_do(){ //上传照片
// $info->thumb(150, 150)->save(ROOT_PATH . 'public' . DS . 'uploads'.DS.$info->getSaveName());
$file = request()->file('file');
$info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
$savename = $info->getSaveName();
$tmp = DS;
$arr = explode($tmp,$savename);
$thumb = \think\Image::open(ROOT_PATH . 'public' . DS . 'uploads'. DS .$savename);
$thumb->thumb(150, 150)->save(ROOT_PATH . 'public' . DS . 'uploads'. DS .$arr[0] . DS .'thumb_'.$arr[1]);
// $url = './uploads/'.$arr[0].'/'.$arr[1];
$url = './uploads/'.$savename;
if (file_exists($url)) {
// file_put_contents('./1.txt',$url);
unlink($url);
}else{
file_put_contents('./1.txt','gg');
}
return 1;
unli
QQ截图20170808203329.png
( 76.46 KB 下载:7 次 )
最佳答案
