【问题标题】:Image not retrieving Laravel图像未检索 Laravel
【发布时间】:2023-03-10 00:10:01
【问题描述】:

我正在尝试检索图像。我没有通过php artisan storage:link 方法创建从 public/storage 到 storage/app/public 的符号链接。而不是这个,我将此代码添加到App::make('files')->link(storage_path('app/public'), public_path('storage'));app/providers/AppServiceProvider.php。但是仍然没有运气图像没有显示,也没有错误。

查看代码:

<img src="/public/storage/{{$main->image_dir}}" /> // /public/storage/main/image.jpg
<img src="/storage/{{$main->image_dir}}" /> // /storage/main/image.jpg
<img src="http://localhost:8000/storage/{{$main->image_dir}}" /> // http://localhost:8000/storage/main/image.jpg

我没有通过以上 3 个链接获得图像。图片存储在这里:storage/app/main

【问题讨论】:

  • 嗨,你的问题看起来更像是谷歌搜索而不是问题,你不觉得吗?
  • @JuangaCovas 真的吗?是什么让你这么认为?

标签: php laravel laravel-5.5 file-storage


【解决方案1】:

我解决了这个问题。

我从storage/app 误删了名为public 的文件夹。我的图像存储在storage/app/main,在这种情况下,图像没有被检索。现在它存储在storage/app/public/main 中并且运行良好。

【讨论】:

    猜你喜欢
    • 2014-06-17
    • 2017-07-18
    • 2018-07-07
    • 2020-01-29
    • 1970-01-01
    • 2021-07-06
    • 2020-07-24
    • 2018-06-11
    • 1970-01-01
    相关资源
    最近更新 更多