Firebase Image Upload to specific folder

Hi,

I am able to upload files to firebase but for the life of me I am unable to figure out how to upload to a folder I created in the console. I am just getting an undefined error.

this formula for the uploadUrl works like a charm

https://firebasestorage.googleapis.com/v0/b/irug-4b1b1.appspot.com/o/”+source.object.name

but this formula which includes the folder name throws an error

https://firebasestorage.googleapis.com/v0/b/irug-4b1b1.appspot.com/"+"profilePicture/”+source.object.name

I have been scouring the docs for any references and have mostly searched all previous answers on the forum here

Thanks

Have you defined this?
image
(note: I used a dynamic binding for my own use case but you can use any path you want - static or dynamic value)

I am not using the firebase upload function as I could not get that to work for me. I am using the Upload Files flow function.

Then check the Firebase documentation for the exact endpoints to use in your use case.

But the AppGyver functions for uploading files to Firestore work well. I suggest your reconsider. Check this great tutorial:

Thanks, will check out the tutorial right now

https://platform.preview.appgyver.com/481355/irug/page.Page3

This is the link to a page I quickly created following the tutorial. It is pretty simple so even though I have double checked all my steps, there is very little scope to mess things up

Still throwing an error

Can’t access.
Which error does it give you?
You got to share your logic flow from the page canvas so we understand better.

I have created an authentication username / password for you

fred@fred.com
fred1234

Here I am binding outputs of resize image as inputs for firestore upload flow function

this is the logic canvas

Can’t login from the device I’m using now.
Can you share the error message(s)?

The error is on port 3 (if this info matters)

code : “allFilesFailed”
message : “Error was thrown because all of the file uploads failed”

Thanks, I really appreciate your looking into this for me

Which option did you pick here?
image

in your preview page before testing , right click and open inspect then test again and look at the response from the red line that will throw an error - if any

Also here show us the raw error message bound to an alert component.

And since I’m going off the laptop now, I’m giving you some more meat to look at in case the previous suggestions lead to no where.

Check your Storage security rules, especially match /{allPaths=}**

Ok thank you for your suggestions, I will check all of this and try to work it out on my own.

If it still fails, hope I can pick your brain some more

Hey,

It works now!

I stumbled upon another thread (Firebase storage upload files issues - #5 by Vikram_Moorthy) and I removed the mimeType property as suggested by other members over. Simply removing mimeType had my function working perfectly.

Thanks for your help in this

1 Like

POSTING FOR THOSE IN A SIMILAR POSITION

I have found a solution to my original query. The trick is not to use a forward slash rather “%2F” for your folder path

So instead of adding the path as pictures/picture1.png you will add it as pictures%2Fpicture1.png and it will work

1 Like

Thanks for sharing your findings with the community.

1 Like