upload_file
Upload files to Mediagraph via local path or base64 data, supporting one-shot, batch, or contribution sessions. Automatically uses multipart for files over 16 MiB.
Instructions
Upload a file to Mediagraph. Two body modes (file_path or file_data) and three session modes:
Body modes:
Local file: Provide file_path for files on the user's local filesystem
Direct upload: Provide file_data (base64-encoded) with filename for files from other sources
Session modes (mutually exclusive):
Default: a fresh one-shot upload session is created and finalized for this single file.
upload_guid: append to an existing session created via create_upload_session. The session is NOT finalized; call set_upload_done when your batch is complete.
contribution_id: upload via a contribution's configured destination (storage folder / lightbox).
Files >16 MiB automatically use S3 multipart upload (parallel parts, retry per part); smaller files go through a single signed PUT.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Filename with extension (required when using file_data) | |
| file_data | No | Base64-encoded file content (use this when file_path is not available) | |
| file_path | No | Absolute path to the file on the local filesystem | |
| upload_guid | No | Append to an existing upload session (from create_upload_session). Caller is responsible for finalizing with set_upload_done. | |
| contribution_id | No | Optional: ID of a contribution (upload link). Mutually exclusive with upload_guid. |