スキル一覧に戻る
HoangNguyen0403

nestjs-file-uploads

by HoangNguyen0403

nestjs-file-uploadsは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。

111🍴 40📅 2026年1月23日
GitHubで見るManusで実行

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

Priority: P0 (FOUNDATIONAL)

Secure file upload handling with validation and storage patterns.

  • Magic Bytes: NEVER trust content-type header or file extension.
    • Tool: Use file-type or mmmagic to verify the actual buffer signature.
  • Limits: Set strict limits: { fileSize: 5000000 } (5MB) in Multer config to prevent DoS.

Streaming (Scalability)

  • Memory Warning: Default Multer MemoryStorage crashes servers with large files.
  • Pattern: Use Streaming for any file > 10MB.
    • Library: multer-s3 (direct upload to bucket) or busboy (raw stream processing).
    • Architecture:
      1. Client requests Signed URL from API.
      2. Client uploads directly to S3/GCS (Bypassing API server completely).
      3. Pro Tip: This is the only way to scale file uploads infinitely.

Processing

  • Async: Don't process images/videos in the HTTP Request.
  • Flow:
    1. Upload file.
    2. Push FileUploadedEvent to Queue (BullMQ).
    3. Worker downloads, resizes/converts, and re-uploads.

スコア

総合スコア

85/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

+5
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

レビュー

💬

レビュー機能は近日公開予定です