Skip to content

feat: add UploadFile class for multipart file upload handling#1374

Open
sansyrox wants to merge 1 commit into
mainfrom
feat/upload-file
Open

feat: add UploadFile class for multipart file upload handling#1374
sansyrox wants to merge 1 commit into
mainfrom
feat/upload-file

Conversation

@sansyrox

Copy link
Copy Markdown
Member

Summary

  • Adds a new UploadFile class in robyn/upload.py that wraps raw uploaded bytes with file metadata (filename, content_type, size) and provides a file-like interface (read/seek/tell/close) plus context manager support.
  • Content type is auto-detected from the filename extension via mimetypes.guess_type, falling back to application/octet-stream.
  • Exports UploadFile from the top-level robyn package via __init__.py and __all__.
  • Adds unit tests covering construction, seek/tell, content type guessing, explicit content type override, context manager usage, and repr.

Closes #1142

Test plan

  • Unit tests pass for all UploadFile functionality
  • CI passes on all platforms

Made with Cursor

Provides a file-like wrapper around uploaded bytes with metadata:
filename, content_type (auto-detected from extension), size, and
standard read/seek/tell methods. Works as a context manager.

Closes #1142

Made-with: Cursor
@vercel

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
robyn Ready Ready Preview, Comment Apr 11, 2026 11:44pm

@coderabbitai

coderabbitai Bot commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@sansyrox has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 32 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 32 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 943a052e-0922-43d0-b4b7-4d2896dc9785

📥 Commits

Reviewing files that changed from the base of the PR and between 3e04c65 and e382a01.

📒 Files selected for processing (3)
  • robyn/__init__.py
  • robyn/upload.py
  • unit_tests/test_upload_file.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/upload-file

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq

codspeed-hq Bot commented Apr 12, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 189 untouched benchmarks


Comparing feat/upload-file (e382a01) with main (3e04c65)

Open in CodSpeed

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.

multipart large file support

1 participant