【问题标题】:GET gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME获取 gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME
【发布时间】:2016-06-28 07:53:56
【问题描述】:

我最近收到此错误消息,不知道为什么。

GET gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME

以下是我对存储服务的引用:

var storage = firebase.storage();

var storageRef = storage.ref();

var storageRefImgs = storageRef.child('images');

我有 Google Chrome 51,我运行的是 Windows 10。

【问题讨论】:

  • 你遇到什么样的错误?
  • 您的浏览器无法识别gs://,通常是http://https://。也许您需要扩展?
  • @ShanmugapriyaD 这是我得到的错误:“GET gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME”
  • @Icycool 问题出在 gs:// URL

标签: angularjs cordova ionic-framework firebase firebase-storage


【解决方案1】:

您似乎将gs:// URL(这是一个内部Google 存储引用)放入无法处理它的控件(例如img 标记)中。

如果您想在img 标记中使用该文件,则必须为该文件使用get the download URL。来自文档:

storageRef.child('images/stars.jpg').getDownloadURL().then(function(url) {
  // Get the download URL for 'images/stars.jpg'
  // This can be inserted into an <img> tag
  // This can also be downloaded directly
}).catch(function(error) {
  // Handle any errors
});

【讨论】:

  • 这似乎有效。非常感谢。现在,我没有使用 标签,而是在
    中使用“background-image: url('img/pic.png')”。我将为此发布另一个问题,因为这个问题已经回答。
  • 我应该怎么做才能从某个位置获取所有文件?
  • 这与这个问题无关,但请参阅:stackoverflow.com/questions/37335102/…
猜你喜欢
相关资源
最近更新 更多
热门标签