Firebase Storage CRUD

Notes to upload and download from Firebase storage.

index.html

<script src="https://unpkg.com/firebase/firebase.js"></script>

main.js

firebase.initializeApp({
apiKey: "[api_key]",
authDomain: "[any_title].firebaseapp.com",
databaseURL: "https://[any_title].firebaseio.com",
storageBucket: "[any_title].appspot.com",
});
var storageRef = firebase.storage().ref();

Create/Update

var file = ... // use the Blob or File API
storageRef.put('images/stars.jpg').then(function(snapshot) {
console.log('Uploaded a blob or file!');
});

Read

storageRef.child('images/stars.jpg').getDownloadURL()

Delete

storageRef.child('images/stars.jpg').delete().then(...)
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.