Skip to content

Add file upload - #35

Merged
herber merged 2 commits into
mainfrom
feat/add-file-upload
Oct 16, 2026
Merged

herber merged 2 commits into
mainfrom
feat/add-file-upload

Conversation

@herber

@herber herber commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Note

Medium Risk
Introduces multipart HTTP handling and direct-to-storage uploads; small direct uploads buffer the full file in memory for retry safety, and misconfigured content types could break presigned PUTs.

Overview
Adds metorial.files.upload so clients can upload paths, bytes, or binary streams, with README examples for common cases.

Uploads ≤100 MB go to POST /files as multipart (MetorialRequest now supports files/data; the endpoint manager forwards them via requests files + data). Larger files use a three-step flow: get_upload_url, unsigned PUT to presigned storage (matching Content-Type, no API auth), then complete. Optional metadata covers purpose, title, instance_id, and store placement (store_id/store_path/store_replace) with client-side validation.

New integration tests cover multipart payloads, presigned flow, validation errors, and API/storage failures.

Reviewed by Cursor Bugbot for commit ba041b1. Bugbot is set up for automated code reviews on this repo. Configure here.

@herber herber self-assigned this Oct 16, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9c9f090. Configure here.

Comment thread src/metorial/_file_upload.py Outdated
@herber
herber merged commit ba041b1 into main Oct 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant