0
我正在使用firebase與angular2。我累了訪問圖像的存儲桶的firebase與圖像的直接url。它提供了一些安全錯誤,但在地址欄中輸入相同的圖像可直接在瀏覽器中查看。Angular2Fire在存儲中訪問圖像
<img src="gs://img url in firebase storage">
然後,我通過以下鏈接Angular2Fire Image access嘗試過的方法。但是它返回的是對象而不是URL訪問。
TS:
recommendedListBind(list){
list.forEach(lists => {
const storageRef = firebase.storage().ref().child(lists.thumbnail);
let thumbnail = storageRef.getDownloadURL().then(url => url);
let Detail = {
title : lists.title,
thumbnail : thumbnail,
}
this.recommendedList.push(Detail);
});
};
HTML:
<ul>
<li *ngFor="let List of recommendedList">
<div class='cards'>
<img src={{List.thumbnail}} alt={{List.title}} title={{List.title}} />
</li>
</ul>
哪些是火力存儲存取圖像正確的做法?
我不使用驗證,並存儲爲開放閱讀所有 – Prabhakaran
然後,你將不得不使用將downloadURL找到[這裏](HTTP: //imgur.com/a/NO78c) –
如果我撤銷意味着我不能使用圖像知道?將使用下載圖像URL是一個安全威脅,因爲存儲是開放給所有人閱讀? – Prabhakaran