How do I upload to a Google Cloud Storage bucket, not the Firebase Storage? According to this documentation , the way you get a reference to the Firebase storage and Cloud storage seem to be exactly the same. But, when I try to access the bucket from Cloud Function, I am given two choices (
gcf-sources-234340858426-us-central1
andus.artifacts.233093489-23.appspot.com
) that are completely different from the Firebase Storage (gs://someaddress.appspot.com
). I'm currently able to upload to Firebase storage with the Firebase SDK from the front end.Can Firebase Storage trigger Google Cloud Function with event triggers?
0
votes
1 Answers
1
votes
Uploading Files
Cloud Storage buckets and Firebase buckets are the same thing under the hood. That said, if you want to use the Google Cloud-specific (i.e. non-Firebase) approach, you can use the client libraries or the REST API.
Triggering functions
Yes - you should be able to trigger a Storage-triggered function by uploading files to a bucket. The deployment command might look something like this:
# Note: this is untested, and assumes you have the Google Cloud SDK installed
gcloud functions deploy my-function --trigger-bucket "someaddress.appspot.com"
Hope this helps!
STORAGE_BUCKET
to a Google Cloud Storage bucket, but I get only an error. – Kevvv