I’m currently working on a site where users are able to upload videos. Right now, with the upload workflow the user is able to upload the file to a bucket in Supabase and then simultaneously create a row in a table in Supabase. I’m trying to add an action in that flow that inserts the url from the bucket into the corresponding row in the table.
I see that similar question has been asked in the past, so apologies if I’m re asking. But, my questions would be
broadly speaking, is this workflow the correct way to go? (upload file to supabase bucket, simultaneously create row in table with metadata that I want for that user, action to retrieve url from bucket then insert into table for user)
How do I retreive that URL from the Supabase bucket? I’ve played around with some of the code snippets that I’ve seen here/on Supabase’s website. Alas, I am no coder and havent gotten that to work in the slightest.
If it was a non-public bucket I would use something like this:
Upload, update row with path; to fetch, get signed URL of row and return the signed URL/change a variable.
The bucket is public. When I go to ‘storage | retrieve public URL’ there isn’t a way for me to select that information from any type of Supabase bucket item. Not sure if there should be; I only have the attached option
Here, you want to select fullPath. Once this runs, it will get the Public URL.
In the next step, you want to go back to Workflow actions, and there it will have returned the URL. (Action 2)
This isn’t the best way, because it could break the sync and you could have orphan images, or rows with corrupted images links. What you probably should do is create a trigger on the image uploaded.
E.g
CREATE TRIGGER Insertar_oaprecios
AFTER UPDATE ON storage.objects
FOR EACH row
EXECUTE FUNCTION cargar_oaprecios_desde_json();
@ace The top one looks like a signed URL. Are you sure your bucket is public?
See if you can go the storage bucket and get the public URL, should be the same.
when I go into the bucket and grab the url for that video I just uploaded though, it gives me back a URL like the one on the top of my previous comment (A signed URL yes?)