Firebase存储下载URL文件结构



所以我使用firebase存储上传我的网站文件。以下是目录结构的示例:

Project
├── index.html
├── css
│   └── style.css
└── js
    └── mainScript.js

所以我将这些文件上传到这个结构中的firebase,但我注意到返回的downloadURL在保留这个结构时不是很友好。。

例如,当我将iframe的src设置为index.html..的downloadURL时,iframe页面缺少style和mainScript文件。

这就是下载URL查找index.html:的方式

https://firebasestorage.googleapis.com/v0/b/App_ID.appspot.com/o/index.html?alt=media&token=some_uid

这就是下载URL查找style.css:的方式

https://firebasestorage.googleapis.com/v0/b/App_ID.appspot.com/o/css%2Fstyle.css?alt=media&token=some_uid等等。

当然,index.html文件在以下位置查找style.css文件:

https://firebasestorage.googleapis.com/v0/b/App_ID.appspot.com/o/css/style.css

但是结果是404。

有办法解决这个问题吗?

PS,当然我不想强迫用户更改他们文件中的URL。。。

不要使用存储来保存您的网站文件!请改用Firebase主机。。。Firebase存储设计用于存储上传/下载文件(图像、音频等(

https://firebase.google.com/docs/hosting/

最新更新