Recall & Review
beginner
What middleware is commonly used in Express to handle multiple file uploads?
Multer is the popular middleware used in Express to handle multiple file uploads easily.
Click to reveal answer
beginner
How do you specify multiple files upload field in Multer?
Use the
upload.array('fieldname', maxCount) method where 'fieldname' is the name of the input field and maxCount is the max number of files allowed.Click to reveal answer
beginner
What property of the request object holds the array of uploaded files when using
upload.array()?The
req.files property contains an array of uploaded file objects when using upload.array().Click to reveal answer
intermediate
Why is it important to set limits on file size and number of files in multiple uploads?
Setting limits prevents server overload, protects from denial of service attacks, and controls storage usage.
Click to reveal answer
intermediate
How can you handle errors during multiple file uploads in Express with Multer?
You can use error-handling middleware or check for errors in the route callback to respond properly if upload fails or files exceed limits.
Click to reveal answer
Which Multer method is used to upload multiple files from a single input field?
✗ Incorrect
upload.array() handles multiple files from one input field. upload.single() is for one file. upload.fields() handles multiple fields.
Where are the uploaded files stored temporarily by Multer before you move or process them?
✗ Incorrect
For multiple files, Multer stores them in req.files as an array of file objects.
What is a good practice to avoid server overload when allowing multiple file uploads?
✗ Incorrect
Setting limits helps protect the server from overload and abuse.
Which property contains the original name of the uploaded file in Multer's file object?
✗ Incorrect
The originalname property holds the file name from the user's computer.
How do you handle errors from Multer middleware in Express routes?
✗ Incorrect
Errors from Multer can be caught in error-handling middleware or by checking the error argument in the route callback.
Explain how to set up multiple file uploads in an Express app using Multer.
Think about middleware setup and how files are accessed in the request.
You got /5 concepts.
Describe why setting limits on file size and number of files is important in multiple file uploads.
Consider server safety and resource management.
You got /4 concepts.