$_POST 获取pay_ceritficate //上传的文件名称信息 if($_POST['pay_certificate']){ //保存支付凭证 $_path = MEDIA_DIR.'/certificate/'; list($type, $data) = explode(',', $_POST['pay_certificate']); do{ $photoname1 = 'pay_'.md5(microtime()).'.jpg'; $picpath = $_path.$photoname1; }while(file_exists($picpath)); $reture1 = file_put_contents($picpath, base64_decode($data), true); if($reture1){ //kernel::base_url(1); //获取域名 $picpath_url = kernel::base_url(1).'/public/images/certificate/'.$photoname1; } if(!$reture1){ $this->begin(); $this->end(false, app::get('b2c')->_('照片上传失败!')); } }
Ecstore php 上传文件
最新推荐文章于 2021-03-16 17:27:44 发布