A servlet is configured to allow only specific file types for upload. What strategies should be implemented to ensure this?
- Rely on the web browser for file type validation
- Use a third-party library for file type validation
- Validate file types on the client side
- Validate file types on the server side
Validating file types on the server side is a more secure approach to ensure that only specific file types are allowed for upload. Relying solely on client-side validation can be bypassed, so it's not recommended. Using a third-party library can also provide robust validation.
Loading...
Related Quiz
- How can servlets be effectively used to implement the front controller pattern in an MVC application?
- For an application that needs to authenticate users based on roles, what is the best approach to implement this in servlets?
- How can you retrieve the output of a stored procedure using CallableStatement?
- When optimizing an MVC application for performance, where should caching strategies be implemented in relation to servlets?
- The __________ method is generally used for fetching data where the request does not affect server state.