File Upload — Techniques · NestJS

Accept a photo for a cat: parse multipart with FileInterceptor, validate the file's size and real type with ParseFilePipe, read the fields beside it, and take several documents at once with FilesInterceptor.

What you will learn

Read the theory for File Upload

All Techniques lessons

All NestJS courses

loading types…

What you'll learn

  • Receive one uploaded file with FileInterceptor and @UploadedFile(), and the form's fields with @Body()
  • Validate an upload's size and real type with ParseFilePipe, MaxFileSizeValidator and FileTypeValidator
  • Receive several files with FilesInterceptor and a maximum count