Not logged in. · Lost password · Register
Forum: General Help and Support Server Setup RSS
Flash Player 10 [and Dokuwiki] - change/remove "Content-Disposition: attachment"
Avatar
iolsmit #1
Member since Nov 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Flash Player 10 [and Dokuwiki] - change/remove "Content-Disposition: attachment"
If flash movies don't play after upgrading to Flash Player 10 this is likely to be the cause:
http://www.adobe.com/devnet/flashplayer/articles/fplayer10…

Starting with version 10,0,2, if Flash Player sees a "Content-Disposition: attachment" header while downloading a SWF file, it will ignore the SWF file rather than play it. Note that this restriction applies only to SWF files and not to other types of content, such as images, sounds, text, or XML files, policy files, etc.

If you control the HTTP server on which the SWF file resides, determine whether you trust the SWF file to execute in the server's domain. If so, remove the "Content-Disposition: attachment" header by changing your HTTP server's configuration.

Or change it to:  "Content-Disposition: inline;"
bci #2
Member since Nov 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Flash Player 10 trouble in practice: How to implement the solution on Apache2?
Hi iolsmit

While the cause of the problem is clear: *.swf-files need to be served with the appropriate [Content-Disposition] header, I don't think the solution for Dokuwiki is that simple. At least I wasn't able to get it working. I have spent many hours over the past days trying to find a practical solution.

Imagine the following situation:
You have a Dokuwiki containing images and flash movies on the one hand (these need to be served with [Content-Disposition: inline]) and PDF files and downloadable QuickTime tutorials on the other (these need to be served with [Content-Disposition: attachment]).
The Dokuwiki is installed on a Ubuntu 8.04LTS box and served via the corresponding Apache 2.2 web server.
Apache-wise the Dokuwiki is served via a <Directory> directive within a <VirtualHost> directive.

At first sight, the following solution, which should unset [Content-Disposition] for flash files only, seems sensible:
<Directory /xyz>
  #apache config instructions
 
  <Files *.swf>
    Header unset content-disposition
  </Files>
<Directory>
However, this doesn't work for Dokuwiki due to its caching mechanism (I believe).

If you want to test whether the concept works at all, this may be tested as follows:
Use a template containing for example *.png pictures. Then use the follwing config:
<Directory /xyz>
  #apache config instructions
 
  <Files *.png>
    deny from all
  </Files>
<Directory>
After emptying the cache of your browser and issuing a "force-reload" command to Apache, you will not receive the *.png files belonging to the template from Apache any more. So the concept itself works.

You might think, that you can solve the issue with the following config:
<Directory /xyz>
  #config instructions
 
  <Files *>
    Header set content-disposition inline
  </Files>
<Directory>
So all files will be integrated into the page. But this applies to the PDF files and the downloadable QuickTime tutorials as well. So when you click those, you'll just get "fetch.php" for download.  :-/

Have you or has anyone out there found a working solution for the Flash Player 10 issue in Dokuwiki yet?

Any good hint would be appreciated!  ;-)
Avatar
iolsmit #3
Member since Nov 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: fetch.php is the place to go
Didn't try this out till today, and indeed fetch.php is the file to change. A quick hack, that worked for me, looks like this:

//application mime type is downloadable
  if (substr($mime,12,17) != 'x-shockwave-flash') {
   if(substr($mime,0,11) == 'application'){
     header('Content-Disposition: attachment; filename="'.basename($file).'";');
   }
  }

Now the movies play with flash player 10.
That, for sure, is not the cleanest solution - maybe someone with a deeper understanding of header config can improve this...
Avatar
andi (Administrator) #4
User title: splitbrain
Member since May 2006 · 3509 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please open a bug report
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
iolsmit #5
Member since Nov 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
I filed a report: http://bugs.splitbrain.org/index.php?do=details&task_i…

Edit: It's already been closed after some hours, so I guess the issue is fixed and will be deployed with the next update (?)

Reason for closing:  Fixed
Additional comments about closing:  content-disposition now configurable

Edit2: You can find more info here: http://dev.splitbrain.org/darcsweb/darcsweb.…?r=dokuwiki…
This post was edited 2 times, last on 2008-12-03, 14:18 by iolsmit.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-01-18, 13:33:37 (UTC +01:00)