1
我正在嘗試離子和firebase平臺,我遇到了問題。錯誤400訪問firebase存儲試圖獲取文件url
所以我有存儲中的圖像我試圖訪問,我試圖使用getDownloadURL()方法,但我不斷收到錯誤400,「無效http方法/ url對」。我無法找到任何解決方案。嘗試使用getMetadata()時出現同樣的錯誤。
firebase已初始化,現在所有的工作都很好,認證,數據庫讀取等等。除了這個錯誤...
我有下面的代碼在服務..
// Get a reference to the storage service, which is used to create references in your storage bucket
var storage = firebase.storage();
// Create a storage reference from our storage service
var storageRef = storage.ref();
// Create a child reference
var imagesRef = storageRef.child('images');
// imagesRef now points to 'images'
return {
getImgRef: function (imgName) {
var imgRef = imagesRef.child('Tanker.ico')
imgRef.getDownloadURL().then(function (url) {
return url
}).catch(function(error) {
switch (error.code) {
case 'storage/object_not_found':
// File doesn't exist
break;
case 'storage/unauthorized':
// User doesn't have permission to access the object
break;
case 'storage/canceled':
// User canceled the upload
break;
case 'storage/unknown':
// Unknown error occurred, inspect the server response
break;
}
});
}
}
一切順利,直到getDownloadURL(),如果同一我嘗試的getMetaData()。
這個問題的任何幫助?