# Drive files

> The part of the drive module that needs attachments, versions, trash and share-links: file uploads and revisions with an optional usage quota, extracted text, storage policies, the bin, starred and recent items, folder share links and the purge event. Installed with drive.

- Category: Content & files
- Module: `drive-files`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/drive
- Page: https://bettersupabase.com/blocks/drive-files

## Install

```bash
npx better-supabase add drive-files
```

The command also installs `updated-at`, `memberships`, `permissions`, `attachments`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by drive-files; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    attachments: {},
    // Modes: "managed", "custom". The default is "managed".
    "drive-files": { mode: "managed" },
  },
});
```

## Client

The block is SQL only: call its functions from your policies, RPCs and the other modules.

## Related blocks

Requires: [attachments](https://bettersupabase.com/blocks/attachments.md)

Works with: [drive](https://bettersupabase.com/blocks/drive.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md), [attachments](https://bettersupabase.com/blocks/attachments.md), [versions](https://bettersupabase.com/blocks/versions.md), [trash](https://bettersupabase.com/blocks/trash.md), [teams](https://bettersupabase.com/blocks/teams.md), [share-links](https://bettersupabase.com/blocks/share-links.md), [settings](https://bettersupabase.com/blocks/settings.md), [guests](https://bettersupabase.com/blocks/guests.md), [imports](https://bettersupabase.com/blocks/imports.md), [data-lifecycle](https://bettersupabase.com/blocks/data-lifecycle.md), [tags](https://bettersupabase.com/blocks/tags.md), [approvals](https://bettersupabase.com/blocks/approvals.md), [rate-limit](https://bettersupabase.com/blocks/rate-limit.md), [usage](https://bettersupabase.com/blocks/usage.md), [numbering](https://bettersupabase.com/blocks/numbering.md), [state-machine](https://bettersupabase.com/blocks/state-machine.md), [relations](https://bettersupabase.com/blocks/relations.md), [acknowledgements](https://bettersupabase.com/blocks/acknowledgements.md), [notifications](https://bettersupabase.com/blocks/notifications.md)
