Last active
July 7, 2020 15:41
-
-
Save nataliaconde/bf209b901b06df420bcc0f264fce6ad2 to your computer and use it in GitHub Desktop.
Firebase Storage: What It Is and How It Works
This file contains 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
var storageRef = firebase.storage.ref("folderName/file.jpg"); | |
var fileUpload = document.getElementById("fileUpload"); | |
fileUpload.on('change', function(evt) { | |
var firstFile = evt.target.file[0]; | |
var uploadTask = storageRef.put(firstFile); | |
uploadTask.on('state_changed', function progress(snapshot) { | |
console.log(snapshot.totalBytesTransferred); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment