Postingan lainnya
Kelas Premium!
Belajar Javascript untuk website
Gunakan kupon "mulaijs" untuk diskon 75 ribu!
Bagaimana caranya Upload image ke storage firebase dengan nodejs
function uploadFile() {
//create a root refrence
var filename = selectedFile.name;
var storageRef = fire.storage().ref('/Images/' + filename);
var uploadTask = storageRef.put(selectedFile);
// Register three observers:
// 1. 'state_changed' observer, called any time the state changes
// 2. Error observer, called on failure
// 3. Completion observer, called on successful completion
uploadTask.on('state_changed', function(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
}, function(error) {
// Handle unsuccessful uploads
}, function() {
// Handle successful uploads on complete
// For instance, get the download URL: https://firebasestorage.googleapis.com/...
var downloadURL = uploadTask.snapshot.downloadURL;
console.log(downloadURL);
});
}
itu adalah function uploadfile saya
0
2 Jawaban:
iya bang.. Soalnya saya masih baru menggunakan firebase jadi enggak tau sama sekali.
0