框架thinkphpphp
这是上传函数和上传路径
class filecontroller extends controller{ public function upload(){ $upload = new \think\upload();// 实例化上传类 $upload->maxsize = 0 ;// 附件上传大小 $upload->exts = array('jpg','gif','png','jpeg');// 附件上传类型 $upload->rootpath = './ueditor/php/upload/image/'; // 附件上传目录 $upload->savename = 'com_create_guid';// 采用guid序列命名 $info=$upload->upload(); if(!$info){ $this->error($upload->geterror()); }else{ foreach($info as $file){ $this->success($file['savepath'].$file['savename'].上传成功!,'',3); } } $model = m('file'); $data['savename'] = $info[0]['savename']; $data['create_time'] = now_time; $model->add($data); }
这是download.html
下载 下载