Build
Files
How to upload, download, and manage files on the Arke network.
Uploading Files
Files are uploaded as multipart form data:
POST /files
Content-Type: multipart/form-data
Authorization: Bearer <token>
file: <binary data>
collection_id: 01JCOL...
name: report.pdfThe system automatically:
- Stores the binary in R2 (content-addressed)
- Creates a file entity with metadata (MIME type, size, storage key)
- Queues processing (OCR, text extraction, embedding generation)
Downloading Files
GET /files/:id/download
Authorization: Bearer <token>Returns the original binary file with appropriate Content-Type headers. Requires the file:download permission action.
File Properties
File entities include these automatic properties:
| Property | Description |
|---|---|
name | Original filename |
mime_type | MIME type (e.g. application/pdf) |
size | File size in bytes |
storage_key | R2 object key |
processing_status | pending, processing, complete, failed |
Versioning
File entities follow the same versioning model as all entities. When you update a file's metadata, a new version is created. Binary content is stored separately in R2 and referenced via the storage_key.