• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

URL-Pattern, Internet Explorer and Flash Videos

 
Greenhorn
Posts: 22
Scala IntelliJ IDE Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,

I'm currently using Servlets (in fact Struts Actions, but my problem is also reproducable with Servlets) to serve binary content stored into a database. Mainly images, pdf files, flash videos, office documents and such. I would like to display the content through the browser when possible, and let the users download the content otherwise.

Everything works fine until the binary data server gets mapped to an .htm extension (business requirement of my application). At that point, IE breaks showing only a blank page.

Here is a reproduced version of the problem:



Works fine with that web.xml


But breaks IE ( blank page) with that one:


I’m aware that can be used to force the download of every single file (inline mode don’t make any difference). Still, it would be a pain to have users downloading files such as jpg images and pdfs just because IE can’t handle MIME types appropriately.

Anyone got a better workaround or suggestion?

Cheers,
 
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 am doing something like this:

 
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


can be used to force the download of every single file (inline mode don’t make any difference). Still, it would be a pain to have users downloading files such as jpg images and pdfs just because IE can’t handle MIME types appropriately.


IE can handle MIME types appropriately it is just a little more complex than just relying on the Content-Type and Content-Disposition headers. I answered a very simmilar question just teh other day explaining some of the intracacies.

Are you sure its IE that is not handling this? What version of the Flash player do you have installed in IE? Is it being used to try to run the SWF? If its not being used at all, check the headers that are set in the response. You can double check you set these correctly with a tool like fiddler. Unless your SWF content really isn't a SWF and your Content-Type is wrong, flash player will be being used (assuming its there).

One other thing: because of the way you are streaming the content a browser will never suggest to the user that Flash Player is required if its not there.
 
Anthony Accioly
Greenhorn
Posts: 22
Scala IntelliJ IDE Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Are you sure its IE that is not handling this? What version of the Flash player do you have installed in IE? Is it being used to try to run the SWF? If its not being used at all, check the headers that are set in the response. You can double check you set these correctly with a tool like fiddler. Unless your SWF content really isn't a SWF and your Content-Type is wrong, flash player will be being used (assuming its there).



Paul, headers are ok. The content is SWF and I tested it using Flash Player 10. Internet Explorer does call Flash and display the video when the content isn't served through a .htm URL (first web.xml), the situation happens when we use the second web.xml file (the content is mapped to /serveFile.htm). You can test it yourself with the code I wrote. Firefox and Safari works fine. The same situation occurs at my real application.
The headers, file, and flash players are exactly the same. The situation only occurs with IE (tested with IE 6 and 7).

Is there any server side workarounds?
I definitively need to have this url mapped to a htm extension for several reasons. I did read MIME sniffing articles at MSDN but telling customers to tweak Internet Explorer options or run .reg files is out of question...
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic