Skip to content

storage.remove not removing item #4133

Discussion options

You must be logged in to vote

You are probably missing the policy for DELETE. Here's an example SQL expression for DELETE policy that works:

((bucket_id = 'test-bucket'::text) AND (storage.extension(name) = 'png'::text) AND (lower((storage.foldername(name))[1]) = 'test-folder'::text))

You can go to Storage > Policies to create policies for your bucket,

For this case you need to use DELETE for allowed operations and provide the above SQL expression:

Depending on who you want to allow to access, here are more examples:
https://supabase.com/docs/guides/storage#allow-individual-access-to-a-file

Replies: 5 comments 21 replies

Comment options

You must be logged in to vote
14 replies
@iamthe-observer
Comment options

@bennik88
Comment options

@iamthe-observer
Comment options

@bennik88
Comment options

@adamzerner
Comment options

Answer selected by fenos
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@GaryAustin1
Comment options

@sturatcliffe
Comment options

@GaryAustin1
Comment options

@sturatcliffe
Comment options

@GaryAustin1
Comment options

Comment options

You must be logged in to vote
1 reply
@ozasadnyy
Comment options

Comment options

You must be logged in to vote
1 reply
@GaryAustin1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet