【发布时间】:2016-11-02 01:34:34
【问题描述】:
所以我正在使用 Firebase 存储来上传我的网站文件。以下是目录结构的示例:
Project
├── index.html
├── css
│ └── style.css
└── js
└── mainScript.js
所以我以这种结构将这些文件上传到 firebase,但我注意到返回的 downloadURL 在保留这种结构方面不是很友好..
例如,当我将 iframe 的 src 设置为 index.html 的 downloadURL 时,iframe 页面缺少样式和 mainScript 文件。
这就是 downloadURL 查找 index.html 的方式:
https://firebasestorage.googleapis.com/v0/b/App_ID.appspot.com/o/index.html?alt=media&token=some_uid
这就是 downloadURL 查找 style.css 的方式:
当然 index.html 文件正在寻找 style.css 文件:
https://firebasestorage.googleapis.com/v0/b/App_ID.appspot.com/o/css/style.css
但结果为 404。
有没有办法解决这个问题?
PS,我当然不想强迫用户更改他们文件中的 url...
【问题讨论】:
-
我也遇到了同样的情况,想将 Unity WebGL 游戏上传到存储中并将其加载到 iFrame 中,但是由于这种奇怪的 URL 随机生成,文件树被破坏并且 iFrame 无法加载.很遗憾,因为 AWS 多年来一直允许这样做。你找到解决办法了吗?
标签: firebase firebase-hosting firebase-storage