Sunday 19 October 2008 2:39:11 pm
Hi, today I installed new version of Adobe Flash Player 10.0.12.36 and noticed that flash files published in eZ Publish are not displayed. Movie is simply not loaded (at least under IE7/Vista and FF3.0.3) and after right clicking on it Flash plugin says in context menu "Movie not loaded". Old Flash Player (ver 9) didn't have any problems with it. After some digging and testing, I found root cause of this issue - by default, eZ Publish inserts following HTTP header for all binary files:
header( "Content-disposition: attachment; filename=\"$originalFileName\"" );
above line is inside:
kernel/classes/binaryhandlers/ezfilepassthrough/ezfilepassthroughhandler.php
After removing this line movies are loaded properly. So I did more digging over the net and found this article: http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_print.html#head32 which explains that handling of Content-Disposition header is a new "feature" of Flash Player 10.
Basically as a solution they suggest to:
a) reconfigure HTTP server to not send Content-Disposition header for trusted Flash files b) or other dodgy workaround in Flash file itself, which as they say may not even work in certain scenarios I suppose this should be handled as bug in eZ Publish to provide more elegant way of dealing with Content-Disposition for SWF files and until this will happen - people should be adviced to manually fix this problem ... ? BTW - I tried more elegant approach - stripping this header in .htaccess with:
<FilesMatch "\.swf$">
Header unset Content-Disposition
</FilesMatch>
but somehow it doesn't work for me, so for now I've to stay with hacking ezfilepassthroughhandler.php :-/ Michal
|