-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(files): update upload method #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ycdzj
commented
Nov 7, 2025
- refactor(files): add metadata headers
- refactor(files): use PostObject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for S3 presigned POST form uploads, enabling direct browser-to-S3 file uploads with size validation. The changes introduce a new upload mechanism alongside the existing presigned URL approach.
- Adds AWS SDK S3 client packages for presigned POST generation
- Implements file size validation with configurable limits
- Extends file creation API to return both presigned URL and POST form data
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds three AWS SDK S3 packages for client, presigned post, and request presigner functionality |
| pnpm-lock.yaml | Lock file updates for AWS SDK S3 dependencies |
| src/files/files.service.ts | Implements S3Client initialization, adds generatePostForm method with size validation |
| src/namespace-resources/namespace-resources.service.ts | Updates createFile to generate and return POST form data |
| src/namespace-resources/dto/file-info.dto.ts | Adds postUrl and postFields properties to DTO, imports Record type |
| src/namespace-resources/dto/create-file-req.dto.ts | Adds size field with validation constraints |
| src/i18n/en/resource.json | Adds "File is too large" error message |
| src/i18n/zh/resource.json | Adds Chinese translation for file size error |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…d into refactor/upload