您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

七牛 图片上传问题

2025/3/24 23:29:43发布30次查看
在用七牛云上传图片时,出现了以下错误
fatal error: uncaught exception 'exception' with message 'file can not open' in /var/www/html/includes/src/qiniu/storage/uploadmanager.php:91 stack trace: #0 /var/www/html/includes/cls_image.php(150): qiniustorageuploadmanager->putfile('2khh1hthknywvgl...', 'images/201609/g...', 'images/201609/s...') #1 /var/www/html/admin/goods.php(1132): cls_image->qiniuupload('images/201609/s...', 'goods_img') #2 {main} thrown in /var/www/html/includes/src/qiniu/storage/uploadmanager.php on line 91
回复内容: 在用七牛云上传图片时,出现了以下错误
fatal error: uncaught exception 'exception' with message 'file can not open' in /var/www/html/includes/src/qiniu/storage/uploadmanager.php:91 stack trace: #0 /var/www/html/includes/cls_image.php(150): qiniustorageuploadmanager->putfile('2khh1hthknywvgl...', 'images/201609/g...', 'images/201609/s...') #1 /var/www/html/admin/goods.php(1132): cls_image->qiniuupload('images/201609/s...', 'goods_img') #2 {main} thrown in /var/www/html/includes/src/qiniu/storage/uploadmanager.php on line 91
请确认上传文件的路径是否有值。即$_files['input-file-name']['tmp_name']七牛云代码定位如下:public function putfile( $uptoken, $key, $filepath, $params = null, $mime = 'application/octet-stream', $checkcrc = false ) { $file = fopen($filepath, 'rb'); //文件不存在,或者不可读 if ($file === false) { //文件为空 throw new \exception(file can not open, 1); //抛出错误的地方 } $params = self::trimparams($params); $stat = fstat($file); $size = $stat['size']; if ($size config, $params, $mime, $checkcrc ); } $up = new resumeuploader( $uptoken, $key, $file, $size, $params, $mime, $this->config ); $ret = $up->upload(); fclose($file); return $ret; }
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product