# s3

Files in any S3-compatible bucket (AWS, R2, B2, MinIO), with SigV4 written
out: put, get, head, delete, list, uploads in parts, presigned GET and PUT
for a browser. The whole of it is [docs/s3.md](../../docs/s3.md).

```text
use "pkg:s3/s3.mote"

s3Upload("invoices/17.pdf", pdf, "application/pdf")?
let link = s3PresignGet("invoices/17.pdf", 3600, "invoice.pdf")?.url
```

It stands on the [aws](../aws/) extension (its SigV4 and its keys), which
`mote.toml` names too: `aws = "…/extensions/aws"`.

Settings: `S3_BUCKET`, `S3_KEY_ID`, `S3_SECRET` (a secret that may be unset, with S3_KEY_ID: then the back end's AWS keys), `S3_REGION`,
`S3_ENDPOINT`, `S3_STYLE`, `S3_PART_SIZE`, `S3_UPLOADS`.

| File | |
|---|---|
| `s3.mote` | The store over it; `s3UploadUrl` for a page. |
| `tests.mote` | Its tests, with AWS's published SigV4 examples: `use "pkg:s3/tests.mote"`, then `mote test`. |

**Not yet run against a real store**: the signing matches AWS's published
examples, and every call runs against a stand-in store that checks each
signature itself (`tests/all.sh real_svc_s3`).
