Recall & Review
beginner
What HTML element is used to allow users to select files for upload in a form?
The <input> element with type="file" is used to let users pick files to upload.Click to reveal answer
beginner
In Flask, which object holds the uploaded file data after a form submission?
Flask stores uploaded files in the request.files dictionary, accessible by the file input's name.
Click to reveal answer
beginner
Why must the form tag include enctype="multipart/form-data" when uploading files?
This encoding type tells the browser to send files and form data properly so the server can read the files.
Click to reveal answer
intermediate
How do you save an uploaded file to the server in Flask?
Use the save() method on the uploaded file object, providing a safe file path to store it.
Click to reveal answer
intermediate
What is a common security practice when saving uploaded files in Flask?
Use werkzeug.utils.secure_filename() to clean the filename and avoid unsafe characters or paths.
Click to reveal answer
Which attribute must a form have to upload files correctly?
✗ Incorrect
The form must have enctype="multipart/form-data" to send files properly.
In Flask, where do uploaded files appear after form submission?
✗ Incorrect
Uploaded files are stored in request.files, not in form or args.
What method do you call on an uploaded file object to save it?
✗ Incorrect
The save() method saves the uploaded file to disk.
Which function helps secure filenames before saving in Flask?
✗ Incorrect
secure_filename() from werkzeug.utils cleans filenames safely.
What input type allows users to select multiple files at once?
✗ Incorrect
Adding the multiple attribute lets users pick several files.
Explain the steps to create a file upload form in Flask and handle the uploaded file safely.
Think about both the HTML form setup and the Flask backend handling.
You got /4 concepts.
Why is it important to use secure_filename() when saving uploaded files in Flask?
Consider what could happen if filenames are not cleaned.
You got /3 concepts.