aspose file tools*
The moose likes Servlets and the fly likes URL-Pattern, Internet Explorer and Flash Videos Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "URL-Pattern, Internet Explorer and Flash Videos" Watch "URL-Pattern, Internet Explorer and Flash Videos" New topic
Author

URL-Pattern, Internet Explorer and Flash Videos

Anthony Accioly
Greenhorn

Joined: Dec 22, 2008
Posts: 16

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,
ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Hi,

I am doing something like this:



Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Anthony Accioly
Greenhorn

Joined: Dec 22, 2008
Posts: 16

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URL-Pattern, Internet Explorer and Flash Videos