【问题标题】:cloudinary images works well with img tag in laravel 8 locally but not on heroku/production -- img displays blank on herokucloudinary 图像在本地与 laravel 8 中的 img 标签配合良好,但在 heroku/production 上不适用——img 在 heroku 上显示空白
【发布时间】:2021-12-28 14:26:06
【问题描述】:

我尝试显示从 cloudinary 上传的图片,但使用下面的图片没有显示

<img style="width:auto" src="https://res.cloudinary.com/hrwev09ub/image/upload/v1637132013/dnpic_1637127942.png">

在此之前,我尝试了上面的 img 标签实际上在本地工作,但不是通过 heroku,因为在 heroku 上,我在检查代码源时可以看到如下

<img style="width:auto" src="dnpic_1637127942.png">

我在 heroku 主机上使用带有 cloudinary 的 Laravel 8 -- 有人可以帮助我解决问题或向我推荐解决方案提示。

【问题讨论】:

    标签: laravel image heroku src cloudinary


    【解决方案1】:

    我是 Danny,在 Cloudinary 的开发者支持团队工作。

    我没有很多部署到 Heroku 的经验,所以我无法说明为什么 src 会删除 https://res.cloudinary.com/hrwev09ub/image/upload/v1637132013 部分,但是我确实注意到完整的图像路径会导致 404 .

    您能否告诉我当您尝试引用示例图像 (https://res.cloudinary.com/hrwev09ub/image/upload/sample.jpg) 而不指定 style=width:auto 时会发生什么?

    这也可能有助于确认您已遵循 Heroku 文档中有关使用 Cloudinary 的所有步骤,可在此处获取:https://devcenter.heroku.com/articles/cloudinary

    谢谢, -丹尼

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-26
    • 2023-03-23
    • 2013-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-30
    • 2013-09-22
    相关资源
    最近更新 更多