NestJS · Junior · Question 61 of 75
How do you handle file uploads in a Nest app on Express?
- 1Nest can't accept files
- 2With
@Body()only - ✓Correct answer: With
FileInterceptor('file')(based on Multer) and the@UploadedFile()parameter decorator
Explanation
Validate size and type with ParseFilePipe and validators like MaxFileSizeValidator. Large files are better streamed to object storage.