4

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

获取 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。

4

1 回答 1

10

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

如果您想在img标签中使用该文件,则必须获取该文件的下载 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
});
于 2016-06-28T13:19:03.910 回答