The response header 'Content-Disposition' with value 'attachment; filename="file.txt"' is set using the __________ method.

  • addHeader()
  • sendRedirect()
  • setContentType()
  • setHeader()
The setHeader() method is used to set response headers, including the 'Content-Disposition' for file downloads.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *