This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pushFileToStorage(fileUpload: FileUpload) { // Pass in a callback as argument | |
const filePath = `${this.basePath}/${fileUpload.file.name}`; | |
const storageRef = ref(this.storage, filePath); | |
const uploadTask = uploadBytesResumable(storageRef, fileUpload.file); | |
uploadTask.on('state_changed', | |
(snapshot) => { | |
// Observe state change events such as progress, pause, and resume | |
// Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded |