To ensure an uploaded file is not malicious, one should validate the file's ________ before saving it.
- File extension
- File size
- File name
- MIME type
The correct option is "MIME type." This is crucial because a file's MIME type provides information about its content, allowing you to verify that the uploaded file matches its claimed type and is not malicious.
Loading...
Related Quiz
- In PHP, what is the purpose of the $this keyword?
- You have a floating-point number in your PHP script and you need to round it to the nearest integer. How would you do this?
- In the context of form validation, what does the term "sanitization" refer to?
- When is a destructor called in a PHP class?
- What does XSS stand for in the context of web security?