Home > Software engineering >  Retrieve audio file from firebase using HTTP
Retrieve audio file from firebase using HTTP

Time:03-08

It's even possible to retrieve data from a firebase storage collection without connect to firebase? I mean, only with HTTP requests?

Example: http.get(Uri.parse('cloud-storage-bucket-url'));

CodePudding user response:

According to the Firebase documentation on download files from storage there are three ways to get the data from the bucket into your browser:

  1. As a byte array
  2. As a Blob object
  3. Through a download URL

The first two options require that you use the SDK to get the data, but while the third option also requires the SDK to generate a download URL, that URL then gives anyone read-only access to the data without needing the Firebase SDK.

The most common flow for this is:

  1. Your code uploads a file that the user selects.
  2. Your code generates a download URL for the new upload.
  3. Your code writes that download URL where other users can find it.

And then all users can get the data from the download URL, however they'd normally do it (fetch is fine, but so are any other tools that can read data from a HTTP URL).

  • Related