https://supabase.com/ logo
hey guys, my storage bucket is set to public and i...
# help
r
hey guys, my storage bucket is set to public and it has universal read, write access in policy but when i get the public url with from.getPublicUrl is says permission denied
n
Hello @reemwn! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
Can you be more clear on the operation that you get that error on? GetPublicUrl does not make a server call to generate the URL.
r
@garyaustin I'm generating url with
from.getPublicUrl()
but when I access the url with the link it gives me back on a browser, I get this. I don't understand what's causing the access denial.
g
Can you show your public URL (at least the part after your instance info)?
r

https://yaqovcsotvbjnqbrbqcq.supabase.co/storage/v1/object/public/lost-pet-spotter/lost-pet-spotter/photos/d9b23738-1027-4bbc-87b8-686dcbc1896e.png▾

@garyaustin
g
So you entered your bucket name when you called public url as part of the file path. You only want the filepath.
r
but I don't understand this is verbatim what's the getPublicUrl() returns
is it because my bucket and project has same name
g
In your call, you put in a string with the bucket in it (getPublicUrl('bucketname/folder/filename') You don't want the bucketname there.
r
ah got it, let me do a quick test then i close this thread if fixed
thanks
works
n
Thread was archived by @reemwn. Anyone can send a message to unarchive it.