← Back to list

nestjs-file-uploads
by ngxtm
⭐ 0🍴 0📅 Jan 23, 2026
SKILL.md
name: NestJS File Uploads description: Secure file handling, Validation, and S3 streaming. metadata: labels: [nestjs, upload, multer, s3] triggers: files: ['**/*.controller.ts'] keywords: [FileInterceptor, Multer, S3, UploadedFile]
File Upload Patterns
Security (Input Validation)
- Magic Bytes: NEVER trust
content-typeheader or file extension.- Tool: Use
file-typeormmmagicto verify the actual buffer signature.
- Tool: Use
- Limits: Set strict
limits: { fileSize: 5000000 }(5MB) in Multer config to prevent DoS.
Streaming (Scalability)
- Memory Warning: Default Multer
MemoryStoragecrashes servers with large files. - Pattern: Use Streaming for any file > 10MB.
- Library:
multer-s3(direct upload to bucket) orbusboy(raw stream processing). - Architecture:
- Client requests Signed URL from API.
- Client uploads directly to S3/GCS (Bypassing API server completely).
- Pro Tip: This is the only way to scale file uploads infinitely.
- Library:
Processing
- Async: Don't process images/videos in the HTTP Request.
- Flow:
- Upload file.
- Push
FileUploadedEventto Queue (BullMQ). - Worker downloads, resizes/converts, and re-uploads.
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon