How can I read and write to Firebase Storage from Cloud Features for Firebase?
1 answer
Cloud functions run in a fairly standard V8 Node.js container. This way, you can use the regular Google Cloud Storage Node SDK to interact with your files.
Code snippet from link:
// Upload a local file to a new file to be created in your bucket.
bucket.upload('/photos/zoo/zebra.jpg', function(err, file) {
if (!err) {
// "zebra.jpg" is now in your bucket.
}
});
But really: just follow the link, it contains a better example than I'm willing to copy / paste here.
+6
source to share