Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ms-excel mime type

 
shiva shankar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to export excel in browser

I am setting content type as




This works perfectly in Firefox but in IE it ends up opening in the browser itself as plain text with junk characters. Any suggestions would be helpful

thanks
Shiva

 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well everything looks fine to me. Did you try it in a different IE than your system. Maybe your IE is corrupt or something. And which version of IE are you using??
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting Content-Types to work in IE is a bit of a black art! Windows doesn't rely solely on the Content-Type header to know what to do, it has an extra step called MIME sniffing whereby it interogates the first n bytes of the response and tries to guess what MIME type it is (see this for more). If you are on XP SP2 or higher you can turn this feature off and see if this is what is clouding the issue.

Assuming IE correctly honours the Content-Type, or correctly sniffs the MIME type it uses the registry key in HKEY_CLASSES_ROOT/MIME/Database/Content Type to map to the application to use. You could double check there to make sure your registry is not corrupt. Unfortunately this MIME database just contains keys to the classes that represent each MIME type so you will have to do more digging to find out what applciation is actually registered to handle a particular MIME type.

 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was facing the same problem in IE in exporting powerpoint using POI in java. If you have multiple tab opened on the browser then the browser renders the content instead of opening it in ms office. I dont know which browser you use but, try installing IE 6. In IE 8 there are bit problems.

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ujjwal soni wrote:Hi,

I was facing the same problem in IE in exporting powerpoint using POI in java. If you have multiple tab opened on the browser then the browser renders the content instead of opening it in ms office. I dont know which browser you use but, try installing IE 6. In IE 8 there are bit problems.



There are far fewer problems in IE8 than there are in IE6. Multiple tabs play no part. IE will not try to open in a browser window unless:
  • The content is something that is embeddable (e.g. a MS Office document)
  • It incorrectly sniffs the content and decides its something the browser can render (for example, an Outlook message might behave like this)

  •  
    shiva shankar
    Ranch Hand
    Posts: 85
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks all. I got it resolved by having the mime type set into the response at first line instead of a few lines below.

    thanks
    Shiva

     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic