laravel对接上七牛云之后,删除图片报错,是什么原因呢?

我使用的是这个扩展

composer require overtrue/laravel-filesystem-qiniu
Storage::disk('qiniu')->delete($url);

之后就报错,但是七牛云上面的图片已经删除

TypeError: Argument 1 passed to zgldh\QiniuStorage\QiniuAdapter::logQiniuError() must be an instance of Qiniu\Http\Error, array given, called in D:\WWW\spanish\vendor\zgldh\qiniu-laravel-storage\src\QiniuAdapter.php on line 343 in file
#0 D:\WWW\spanish\vendor\zgldh\qiniu-laravel-storage\src\QiniuAdapter.php(343): zgldh\QiniuStorage\QiniuAdapter->logQiniuError(Array, 'spanishknow/vid...')
#1 D:\WWW\spanish\vendor\league\flysystem\src\Filesystem.php(237): zgldh\QiniuStorage\QiniuAdapter->delete('video/\xE4\xB9\x9D\xE5\xB0\xBE\xE7\x8B\x90...')
#2 D:\WWW\spanish\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemAdapter.php(351): League\Flysystem\Filesystem->delete('video/\xE4\xB9\x9D\xE5\xB0\xBE\xE7\x8B\x90...')
#3 D:\WWW\spanish\app\Http\Controllers\Inside\QuestionFilesController.php(85): Illuminate\Filesystem\FilesystemAdapter->delete(Array)
#4 [internal function]: App\Http\Controllers\Inside\QuestionFilesController->destroy('28')
#5 D:\WWW\spanish\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(54): call_user_func_array(Array, Array)
#6 D:\WWW\spanish\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('destroy', Array)
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 5
Storage::disk('qiniu')->delete($url);
$questionfile->delete();

这个$questionfile从哪里来的呢,如果要删除,这一段Storage::disk('qiniu')->delete($url);就已经删除了呀,为啥下面还要加一个$questionfile->delete();

3年前 评论
吴涛 (楼主) 3年前

我用的这个一切正常 qiniu/php-sdk

3年前 评论

我也遇到同样的错误,怎么解决的

3年前 评论
吴涛 (楼主) 3年前
Coolr 2年前
吴涛 (楼主) 2年前
Coolr 2年前
吴涛 (楼主) 2年前

好像是因为要求是字符串,给定数组的意思,最粗暴的办法你去把报错的那行代码给注释了

2年前 评论

回复一下解决方案$error = $bucketMgr->delete($this->bucket, $path);改为list($ret, $error) = $bucketMgr->delete($this->bucket, $path);

2年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!