tp6 文件类型验证
时间:2020-09-16 14:44:45
收藏:0
阅读:415
public function test(){ try { $file=$this->request->file(); $res=validate([‘file‘=>‘fileExt:xlsx,jpg‘],[],false,false) ->check($file); if(!$res){ return ‘文件格式不正确‘; } }catch (Exception $e){ } }
原文:https://www.cnblogs.com/CanyingV/p/13678920.html
评论(0)