A NestJS API receives file uploads. Which professional practice minimizes security risk?
-
A
Accept all file types and sizes without restriction
-
B
Validate file type via MIME type and magic bytes, enforce size limits, and store files outside the web root
-
C
Store uploaded files in the database as base64 strings
-
D
Use a public S3 bucket with no access controls