上传代码

// 缩略图上传
            $upload = new \Think\Upload();// 实例化上传类
            $upload->maxSize   =     3145728 ;// 设置附件上传大小
            $upload->exts      =     array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
            $upload->rootPath  =     './Upload/'; // 设置附件上传根目录
            $upload->savePath  =     'images/'; // 设置附件上传(子)目录
            $upload->subName   =     array('date', 'Ym');     
        
// 上传文件 $info = $upload->upload(); if(!$info) {// 上传错误提示错误信息 $this->error($upload->getError()); return false; } $goods_thumb = $info['upload']['savepath'].$info['upload']['savename'];

 $upload->subName ='';上传文件地址 /Upload/imagex/xxxx。

$upload->subName = array('date', 'Ym');   上传文件地址/Upload/imagex/201607/xxxx

相关文章:

  • 2022-01-08
  • 2022-01-08
  • 2021-11-26
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
猜你喜欢
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
  • 2022-01-08
相关资源
相似解决方案