Created
July 4, 2018 12:00
-
-
Save tonis2/9f87420a12e409009761a45b5787e156 to your computer and use it in GitHub Desktop.
UPLOAD to FIREBASE storage with REST API
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
### Add security rule for public access | |
service firebase.storage { | |
match /b/{bucket}/o { | |
match /{allPaths=**} { | |
allow read, write; | |
} | |
} | |
} | |
POST to this url https://firebasestorage.googleapis.com/v0/b/[APP_ID]/o/[FOLDER_NAME]%[FOLDER_NAME]%2F[FILENAME]?alt=media | |
##POST HEADER | |
{ | |
headers: { "Content-Type":"text/html" }, | |
mode: "cors", | |
cache: "default" | |
}; |
This was a huge lifesaver for me. Thanks for providing this!
I spent so long looking for this I can't believe it.
I actually did find this an hour ago and didn't see that I was using storage instead of firebasestorage in my url.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wish Google was documenting this... thanks for sharing!