Files
supabase/apps/reference/_supabase_js/generated/storage-from-remove.mdx
2022-08-23 13:39:26 +08:00

61 lines
1.3 KiB
Plaintext

---
id: storage-from-remove
title: 'from.remove()'
slug: /storage-from-remove
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Deletes files within the same bucket
```js
const { data, error } = await supabase.storage
.from('avatars')
.remove(['folder/avatar1.png'])
```
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
paths
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>object</code>
</span>
</h4>
<div class="method-list-item-description">
An array of files to delete, including the path and file name. For example [`'folder/image.png'`].
</div>
</li>
</ul>
## Notes
- RLS policy permissions required:
- `buckets` table permissions: none
- `objects` table permissions: `delete` and `select`
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
## Examples
### Delete file
```js
const { data, error } = await supabase.storage
.from('avatars')
.remove(['folder/avatar1.png'])
```