【问题标题】:Get public url for object uploaded on cloud storage获取上传到云存储的对象的公共 URL
【发布时间】:2019-08-11 02:21:01
【问题描述】:

我在云存储上上传了一个 pdf 文件。但是当我访问 url https://storage.cloud.google.com/[BUCKET]/[FILE].jpg 时,我被重定向到谷歌登录页面。有没有办法获得一个可以直接访问文件并且没有 CORS 问题的公共 url。

【问题讨论】:

    标签: google-cloud-platform cloud google-cloud-storage


    【解决方案1】:

    这是一个愚蠢的错误。 使用

    storage.googleapis.com/<bucketName>/<fileName> 
    

    而不是

    storage.cloud.google .com/<bucketName>/<fileName> 
    

    【讨论】:

    • 很好地找到了您的问题的解决方案。请尽快将此问题标记为已解决,以提高其知名度。
    • 谁能解释一下 wtf 是怎么回事
    • @DarrenZou 有什么问题?
    • 好的,现在我想通了,但你可以澄清一下:使用:
    • storage.googleapis.com{bucket Name}/{filename} 而不是 storage.cloud.google .com/{bucket Name}/{filename} 因为我对解决方案感到困惑
    猜你喜欢
    • 2012-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-19
    • 1970-01-01
    • 2020-09-20
    • 2021-09-08
    • 2020-04-20
    相关资源
    最近更新 更多