An error occurred due to an unresolved FirebaseStorageError: "storage/object-not-found". The message indicates that the object 'k91a73uzb99' does not exist in Firebase Storage. This type of error is categorized under FirebaseError with a code of 404 and a related status indicating failure to get the object.
export class ReportComponent implements OnInit {
ref: AngularFireStorageReference;
task: AngularFireUploadTask;
newUrl: Observable<string>;
constructor(private firesStore: AngularFireStorage,
) { }
ngOnInit() { }
async onSelectFile(event) {
const id = Math.random().toString(36).substring(2);
this.ref = this.fireStore.ref(id);
this.task = this.ref.put(event.target.files[0]); /*
.snapshotChanges()
.subscribe( (value) => {
}); */
this.uploadPercent = this.task.percentageChanges();
// get notified when the download URL is available
this.task.snapshotChanges().pipe(
finalize(() => {
this.newUrl = this.ref.getDownloadURL();
console.log(this.newUrl);
})
).subscribe();
}
Expected: < storageBucket >/o/< ref(id) >?alt=media&token=<........>
Actual: < storageBucket >/o/< ref(id) >