• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1395
  • Last Modified:

Content type in a servlet

I am trying to redirect the contents of my page to a spreadsheet and I use
res.setContentType("application/vnd.ms-excel");
to set the content type.
This works when I use Excel 97 but with newer releases of Excel (eg: 2000) it doesn't.
Help!!!
Thanks.
0
luw
Asked:
luw
  • 4
  • 2
1 Solution
 
dvijiCommented:
Hi,
   Some suggestion to find out that MIME Type...
  Open explorer and goto View -> Folder Options. In that goto file types tab, in that search for Microsoft Excel Worksheet. It will give you what is the Content Type(MIME type). Apply this in your ContentType. It may help you.


...dviji
0
 
luwAuthor Commented:
Thanks. Now I know what the MIME types are for Excel 97 and Excel 2000. But how can write my servlet to work with both versions? Thanks.
0
 
luwAuthor Commented:
Thanks. Now I know what the MIME types are for Excel 97 and Excel 2000. But how can write my servlet to work with both versions? Thanks.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
dvijiCommented:
You can get the available mimie types by using javascript navaigator.mimeTypes

But one thing is navigator works only in Netscape ;-(((. I don't know how to check in IE...

...dviji
0
 
luwAuthor Commented:
Thanks for the info. Can you give me some examples on how I can use it?
0
 
luwAuthor Commented:
Thanks for all the info. I'm still trying to find out how to get my code to work with Excel 2000. Sorry for the delayed repsonse!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now