Tried adding RSL, so anon can select, insert, upda...
# off-topic
b
Tried adding RSL, so anon can select, insert, update and delete and seem to run into the same issue with uploadinh.
g
A public bucket only means there is a fixed url that can be used to read the file by anyone. All other storage operations require valid policy. Try setting your policy to true and see if it works.
b
I've given that a go @User , not too sure if it's a problem with the editor or just the way I've set it up with my RSL. But doesn't seem to work with it all true either.
g
I normally put the policies under each bucket. It would think true where you have it might work (you don’t actually show the policy), but I’ve never used that section
b
Not sure what happened, but it seems to upload the data now. Is there generally a delay when you update the row level security?
And just FYI, when you put it under each bucket as just a true. It automatically moves the Policy to that row I have it in. I might try it with auth now. Cheers for the help!
Is it okay to leave this thread open? There's a chance I may have some RSL issues
g
No delay on upload I don't think, might be on download because of caching.
It will close automatically tomorrow if you don't.
Storage RLS
b
So it seems like that RLS error comes up when there's duplicate uploads of the same file name. Do people normally concat a date+time to the file name to avoid that error?
g
Not sure why that would cause an RLS error (versus some other error) unless you have upsert=true which would then attempt to replace and need valid select policy in addition to insert policy (I believe). You can add time to avoid it. I don't do anon uploads, so in my case I actually have the uuid in the path and replace.
b
I do have upsert as true in this case. But shouldn't that mean that the update should work, since my current policy is true for select, insert and update. Oh that's a good idea to generate a uuid to replace the filenames
g
On uuid, I meant I sort of have a directory for each user, but random uuid pathnames are good... If you were getting RLS error only with duplicate file, that seems to say select policy is not working for some reason.
b
My Select policy is set to true as well in this case.