• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ms-excel mime type

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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

     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic