Files
supabase/apps/reference/_supabase_js/generated/storage-from-remove.mdx
2022-08-15 15:27:07 +02:00

60 lines
1.2 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 be deleted, including the path and file name. For example [`folder/image.png`].
</div>
</li>
</ul>
## Notes
- Policy permissions required:
- `buckets` permissions: none
- `objects` permissions: `delete` and `select`
## Examples
### Delete file
```js
const { data, error } = await supabase.storage
.from('avatars')
.remove(['folder/avatar1.png'])
```