pragma/file resource for uploading and managing files. Files are stored in platform storage and expose download URLs that other resources can reference.
Prerequisites
- pragma CLI installed and authenticated (
pragma auth login)
Using the CLI
Upload with @path syntax
The simplest way to upload a file is using the@path syntax in your YAML config:
- Reads the file from the local path (relative to the YAML file’s directory)
- Uploads the file content to pragma-os storage
- Creates the
pragma/fileresource to track it
File Outputs
After the file resource reachesready state, it exposes these outputs:
| Output | Description |
|---|---|
url | Internal storage URL |
public_url | Public download URL |
size | File size in bytes |
content_type | MIME type |
checksum | Content checksum for integrity verification |
uploaded_at | Upload timestamp |
Using the SDK
Upload programmatically
Referencing Files from Other Resources
File outputs can be referenced by other resources using FieldReferences. For example, to use an uploaded document as a knowledge source for an AI agent:Supported Content Types
Any MIME type is supported. Common examples:| Content Type | Use Case |
|---|---|
application/pdf | Documents, manuals |
application/json | Configuration files, datasets |
application/jsonl | Training data, log files |
text/plain | Text documents, CSV files |
text/csv | Tabular data |
image/png, image/jpeg | Images |
Next Steps
Reactive Pipelines
Build pipelines where file changes automatically propagate.
CLI Resources
Full resource management commands.