@Erel 's Firebase Storage library is easy to setup and easy to use.
A Testproject is working well with and without authentication.
The "UploadCompleted" event delivers the Serverpath (1), which is fine so far and can be used with the gs:\\ protocol (2) by authenticated users.
In order to download the file from unauthenticated users a https:\\-URL (3) is needed.
So, this is the question:
I could find this valuable information in SO here but was not able to get a grip on a solution:
The Firebase documentation gives some explanations, but in a language with "curly brackets" ...
I saw this post from @alwaysbusy 's wonderful "ABMaterial"-world, but it's B4J.
___
Please ignore the attached file. I can't remove it since the normal "Edit"-"More options" produces a "ERR_BLOCKED_BY_XSS_AUDITOR"
A Testproject is working well with and without authentication.
In order to download the file from unauthenticated users a https:\\-URL (3) is needed.
So, this is the question:
How to get the Firebase Storage public https://-URL from the storage object? (4)
I could find this valuable information in SO here but was not able to get a grip on a solution:
"Luckily Firebase Storage gives both URLs that we can use to represent files."
// "Private" internal URL, only accessible through Firebase Storage API
// This is protected by Firebase Storage Security Rules & Firebase Auth
gs://bucket/object
// "Public" unguessable URL, accessible by anyone with the link
// This is secured because that token is *very* hard for someone to guess
https://firebasestorage.googleapis.com/v0/bucket/object?alt=media&token=<token>
The first option requires that you use the reference.getDownloadURL() method to convert the internal gs:// URL into a public https:// URL.
The second option allows you to share this public but unguessable URL with trusted individuals, and allows them to access content without authentication to Firebase or using your app--think sharing family photos with Google Photos. Likely this behavior will be good enough, unless you desire public sharing with clean URLs. You can use this URL in a browser, or use any other HTTP library to download it. We provide the ability to download these files as well (off a reference), so you don't need to get a third party library, you can just use us.
The Firebase documentation gives some explanations, but in a language with "curly brackets" ...
I saw this post from @alwaysbusy 's wonderful "ABMaterial"-world, but it's B4J.
___
Please ignore the attached file. I can't remove it since the normal "Edit"-"More options" produces a "ERR_BLOCKED_BY_XSS_AUDITOR"
Attachments
Last edited: