manage_files
Get file URLs, download files, or upload new files to a record in PocketBase.
Instructions
USE WHEN you need to get a file URL, download a file, or upload a new file to a record.
EXAMPLES:
URL: manage_files(action="url", collection="posts", record_id="abc", field="cover", filename="img.jpg")
Thumb: manage_files(action="url", ..., thumb="200x200")
Download: manage_files(action="download", ..., filename="doc.pdf")
Upload: manage_files(action="upload", ..., field="cover", local_path="/tmp/img.jpg", filename="img.jpg")
NEXT STEPS: find_records to see the updated file field after upload.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | Field name that holds the file. | |
| thumb | No | Thumbnail size for image fields, e.g. '100x100'. Only for url action. | |
| action | Yes | url: get the file URL; download: fetch file bytes; upload: upload a local file. | |
| filename | No | Filename as stored in the record (required for url/download). | |
| record_id | Yes | Record id that owns the file. | |
| collection | Yes | Collection name or id. | |
| local_path | No | Absolute local path to upload (required for upload action). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||