【问题标题】:File not found exception in existing file on Digital Ocean space with laravel使用 laravel 在数字海洋空间的现有文件中找不到文件异常
【发布时间】:2020-12-19 22:34:51
【问题描述】:

我已经使用为数字海洋空间配置的 Laravel s3 驱动程序上传了一个文件。现在我想使用 api 请求下载文件。下载代码为:

return \response()->download(Storage::disk('do')->url($user->cv), $user->name);

它给了我一个错误响应说

The file "https://lms3.fra1.digitaloceanspaces.com/answers/3/ygcFuQfmVgdcxWRteE3hTlF0CuntsycSQmuDystT.pdf"

但该文件确实存在,您可以查看此链接。 这段代码有什么问题?

【问题讨论】:

  • 如果我不得不在没有看到太多代码的情况下猜测,我会认为这是由于权限设置不正确。此外,在response() 之前不需要\ ,因为response() 是一个全局函数。

标签: laravel amazon-s3 digital-ocean digital-ocean-spaces


【解决方案1】:

我有同样的问题,我刚刚找到了一个(糟糕的)解决方法。或者至少是让 Laravel 找到文件的方法。

php artisan cache:clear

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    • 1970-01-01
    • 2019-01-16
    • 2019-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多