Skip to content

How do I store the URL in the firestore database? #4

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
antojsh opened this issue Feb 14, 2019 · 1 comment
Open

How do I store the URL in the firestore database? #4

antojsh opened this issue Feb 14, 2019 · 1 comment

Comments

@antojsh
Copy link

antojsh commented Feb 14, 2019

No description provided.

@workforfilmsGithub
Copy link

  this.percentage = this.task.percentageChanges();
  this.snapshot   = this.task.snapshotChanges().pipe(
    tap(snap => {
      console.log(snap);
      if (snap.bytesTransferred === snap.totalBytes) {
        this.loaded = true;
     const path = 'uploads/' + uid + '/' + foldername + '/' + filename + '.jpg';
        const profilePictureRef = this.afstorage.ref(path);
       this.profilePictureRef.getDownloadURL().subscribe(URL => {
          this.url = URL;
          this.imgURL = URL;
          console.log(URL);
        this.db.collection('user-profiles').doc(this.uid).set({photoURL: URL}, {merge: true});
        });
        // this.loaded = true;
      } 
    }),
  );

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants