storage.remove not removing item #4133
-
Per the documentation found here: https://supabase.com/docs/reference/javascript/storage-from-remove I'm currently calling: const { data, error } = await supabase with the correct bucket and file path for my app. This seems to be successful, returning: { "data": [], "error": null } but when I visit the supabase website the file is still there. I imagine this is due to the lack of a policy. Is there documentation on policies somewhere that provides more examples than the few templates available? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 21 replies
-
You are probably missing the policy for DELETE. Here's an example SQL expression for DELETE policy that works:
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: |
Beta Was this translation helpful? Give feedback.
-
while deleting this error showing 'List' is not a subtype of type 'String' in flutter |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm getting this exact issue when trying to delete files from a node.js environment, but I have the correct policies in place - has anyone else had this issue for reasons other than missing RLS policies? |
Beta Was this translation helpful? Give feedback.
-
Hi there, I was having a similar issue with this code:
It was returning me The problem was the initial |
Beta Was this translation helpful? Give feedback.
-
Hi current experience this issue its returning Also do i really need to create a folder inside the bucket or not? my implementation was directly saving files on a bucket |
Beta Was this translation helpful? Give feedback.
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