0
I have following code snippet for upload Storage firebse I am using typescript.
uploadPhoto(photo) {
//Get File
this.file = photo.files[0]; // Erro nessa linha
this.metadata = {
'contentType': this.file.type
};
//Create a storage ref
this.storageRef = firebase.storage().ref().child('images/');
// Upload file
this.storageRef.put(this.file, this.metadata);
}
he make following mistake:
TypeError: Cannot read property 'files' of undefined
am passing: uploadImage() { this.userProvider.uploadPhoto(this.Photofield); }
– Douglas William
Check the
this.photoField
. He must be as Undefined.– Javeson Yehudi