图片上传处理

 

}
 
public function set_images(){

    $this->image=[];

    $image = $this->request->file('image');

    if(!is_array($image)){
        $this->image[]=$image;
    }else{
        $this->image=$image;
}


public function up_local($file){

    $info = $file->rule(function(){
        return tool::token();
    })->move($this->lin_path);

    if (empty($info)) {
        $e = new apis_exception();
        $e->seterror(606);
        throw  $e;
    }

    $imgpath=$this->lin_path.$info->getSaveName();

    $info=null;
    unset($info);

    return $imgpath;
}

 


}




















 


posted @ 2018-06-22 15:54  王芬老师  阅读(141)  评论(0编辑  收藏  举报