Loading

Quipoin Menu

Learn • Practice • Grow

express-js / Express.js File Uploads (Multer)
mcq
Direction: Choose the correct option

Q1.

What is Multer?
A. A database driver
B. An image processing library
C. A middleware for handling multipart/form-data (file uploads)
D. A middleware for parsing JSON
Direction: Choose the correct option

Q2.

How do you configure Multer to store uploaded files on disk?
A. multer.diskStorage({ destination: ... })
B. const upload = multer({ dest: 'uploads/' })
C. Both A and B
D. const upload = multer().disk('uploads/')
Direction: Choose the correct option

Q3.

How do you handle a single file upload with field name 'avatar'?
A. upload.any()
B. upload.single('avatar')
C. upload.array('avatar')
D. upload.fields([{ name: 'avatar' }])
Direction: Choose the correct option

Q4.

Where can you access information about the uploaded file (like filename) in the route handler?
A. req.files
B. req.file
C. req.params.file
D. req.body.file
Direction: Choose the correct option

Q5.

What is a common security concern with file uploads?
A. File naming conflicts
B. Allowing malicious files (like scripts) to be uploaded and executed
C. Slow upload speed
D. File size too large