0
我想等到使用裝載機上載火力存儲圖像,但它不能正常工作如何要等到圖像上傳到火力存儲在離子2
我寫了我這樣的代碼,但我不不知道我的錯誤在哪裏,以及爲什麼在上傳過程中顯示警報。
private uploadPhoto(): void {
let loader = this.loadingCtrl.create({
content: ""
})
loader.present().then(_=>{
this.myPhotosRef.child(this.generateUUID()).child('myPhoto.JPEG')
.putString(this.myPhoto, 'base64', { contentType: 'image/JPEG' })
.then((savedPicture) => {
this.myPhotoURL = savedPicture.downloadURL;
this.afd.list('/Images/').push({
nID: this.appService.id,
url: this.myPhotoURL,
date: new Date().toISOString()
});
});
}).then(_=>{
alert("image uploaded and stored in database");
loader.dismiss();
})
}
添加在第一回,然後返回'...... this.myPhotosRef.child ' –
@mohamadrabee是的,我忘了寫回去..謝謝mohamad –