MS Excel has the following observed MIME types:
Is there any one type that would work for all versions? If not, do we need to set
response.setContentType() with each one of these mime types individually?
Also, we use file streaming in our application to display document (not just excel - any type of document). In doing so, how can we retain the filename if the user opts to save the file - currently, the name of the servlet that renders the file appears as the default name.
This question is related to
I believe the standard MIME type for Excel files is
Regarding the name of the document, you should set the following header in the response:
header('Content-Disposition: attachment; filename="name_of_excel_file.xls"');