Firebase Storage - dedicated folders for users?

Hi, me again... :slight_smile:
Unfortunately I had no time to work previously on the app I was working on and I stated again during these days.
I tried to collect all information and to fill them into the app but something doesn't work and now I'm blocked as registrations are not uploaded to Firebase.

A quick recap, the app has to register voices of different people and upload them to Firebase Storage in dedicated folders for each person, then selecting a specific person from a list related registrations have to be displayed in a dedicaed page in order to be selected and listened.

Here attached the .aia file on which I'm working on, can you help me to complete the app, please?
A "Screen1" screen is present jutìst because I would like to display the list of people as different buttons (and have the opportunity to add people if necessary).

Thank you for your help! :slight_smile:
SoundRecorderToFBStorage.aia (284.5 KB)

I will have a look at where you have got to so far....

Thank you very much!
For your info, a 1104 error occured when try8n to upload the registration

OK, this is just from looking at your blocks

  1. Use POST not PATCH for Firebase Storage

image

  1. The file download token is returned after you post a file to FirebaseStorage in the responseContent:

Get it here
image

instead of this (?):

  1. My Italian is not good, I do not quite understand what is going on here:

image

You only appear to be patching a key with no value ?
What is the value/content of "response" ?

  1. You are not using Firebase Authentication for your users ?
    This might make it easier to set secure rules to allow each user to access only their data. You do not necessarily need "folders" in FirebaseStorage, you can control file access with secure rules.

This is all I have found so far........

I presume you have had a good read of this:

https://ai2.metricrat.co.uk/guides/firebase-with-a-web-component

Ok, I switched the PATCH block to the POST one and I modified the file downl9ad token block as you suggested but the 1104 error stil remain

As for the 3rd point, it is for adding people in case they are not already presebt in tge list (that will be used at the starting point for selecting them (the intro page will have a list of people and selecting one of them the related list of recordings will be displayed).

I don't want to use authentication as most of people that wipl use the app are not so skilled with smartphones and doing so it is more easier.

Because you are uploading the file to the root of your Firebase Storage you do not need to include the %2F in the file path. (%2F is the html entity for a / and is only required before a filename in a folder).

Try with this upload path:

https://firebasestorage.googleapis.com/v0/b/test-8083b.appspot.com/o/TEST.3gp?alt=media

I deleted the %2F part but the same error occurred

Any rules set on your storage project ?

I tested using a newly created storage project with the following rules (test mode)

rules_version = '2';

service firebase.storage {
  match /b/{bucket}/o {

  match /{allPaths=**} {
      allow read, write: if request.time < timestamp.date(2024, 1, 12);
    }
  }
}

these blocks

It is worth also setting the content type in the header blocks to set the correct file type.

responseContent output:

{
  "name": "test.mp3",
  "bucket": "my-project.appspot.com",
  "generation": "1702483597268985",
  "metageneration": "1",
  "contentType": "audio/mp3",
  "timeCreated": "2023-12-13T16:06:37.308Z",
  "updated": "2023-12-13T16:06:37.308Z",
  "storageClass": "STANDARD",
  "size": "13836",
  "md5Hash": "GahsYbPPM45H60JtqgeZ5Q==",
  "contentEncoding": "identity",
  "contentDisposition": "inline; filename*=utf-8''test.mp3",
  "crc32c": "Zx8VaQ==",
  "etag": "CPmvtNDljIMDEAE=",
  "downloadTokens": "475fcb31-5a0c-42de-ba3a-527d4dc863d3"
}

Storage rules updated with ones you shared ({bucket} changed with the project name) and blocks set as suggested (after the name of the file has been filled into the notifier).

Same error e no response on the label... :frowning_face:

Is this:

image

just a filename without an extension ?

This should be file:// not https://

image

Is it not ok to link the extension like this?

image

https:// updated with file:// :slight_smile:

It is OK, just checking that you checked what the value of this variable is....

Is it working now ?

Nope, same error :frowning_face:

I won't recommend to just do it now but whenever you like to try something new, you are welcome to check this extension.

Missed this. Do not change this. It should be {bucket} !!

Nothing, same result...

Did you put anything in here:

image

It is just an empty text block I left behind.....

Are you certain that the file get response + .mp3 is in your ASD files folder ?

The error is on the app side of things before we get to FirebaseStorage....

Mmm I suppose that this could be the error...
So I need to first save the file into the ASD file folder and then upload it to FB Storage, correct?

I missed this part, can you share blocks for adding this step, please?

Where is the file ?