# recipes/uploads

A page uploads pictures under the gate and they paint from `/files/<id>`; each refusal reaches the page with its reason, a module makes a file of its own, and the static battery behind it never sees a file.

The server half: the uploads battery, the static battery behind it, the auth battery, and a gallery module that makes a file of its own. Everything else is a module in ./modules.

```sh
PORT=8080 AWEFT_UPLOADS_DIR=var/uploads AWEFT_SITE_DIR=dist node recipes/uploads/backend/main.ts
```

## Files

- [`backend/main.ts`](/docs/recipes/uploads/files/backend/main.ts)
- [`backend/modules/gallery/Export.ts`](/docs/recipes/uploads/files/backend/modules/gallery/Export.ts)
- [`backend/modules/static/Files.ts`](/docs/recipes/uploads/files/backend/modules/static/Files.ts)
- [`backend/modules/uploads/Files.ts`](/docs/recipes/uploads/files/backend/modules/uploads/Files.ts)
- [`main.ts`](/docs/recipes/uploads/files/main.ts)
- [`page/entry.tsx`](/docs/recipes/uploads/files/page/entry.tsx)
- [`page/index.html`](/docs/recipes/uploads/files/page/index.html)
- [`page/vite.config.ts`](/docs/recipes/uploads/files/page/vite.config.ts)
