冷杉基本存储中存储的图像无法下载

时间:2018-09-26 14:25:35

标签: typescript firebase angular6 firebase-storage imagedownload

将图像上传到Firebase存储后,我无法从存储快照下载图像URL。

     let snap;
    this.selectedFiles = event.target.files;
    const file = this.selectedFiles.item(0);
    this.currentFileUpload = new Fileup(file);
    this.userService.pushFileToStorage(this.currentFileUpload, this.progress).on(firebase.storage.TaskEvent.STATE_CHANGED,
        (snapshot) => {
            // in progress
            this.loaded  = true;
            snap = snapshot as firebase.storage.UploadTaskSnapshot;
        },
        (error) => {
            // fail
            console.log(error);
        },
        () => {
            // success
            console.log('in complete url' + snap.downloadURL);
            this.uploadedfile = snap.downloadURL;
           this.loaded = false;
        });
}

0 个答案:

没有答案