Flash content stops working with Flash Player 10

I am doing some work on a new Drupal module at the moment that will add my flash node functions to the content constructor kit (CCK) (see the FlashField project page for details). It had all been working well until today when I installed the Flash Player 10 update, and then the content no longer appeared in Firefox or Safari.

A bit of fault finding pinned it down to using the private file system, and then only private files associated with the FileField module (which my new FlashField module relies on).

It turns out the issue is because FileField serves files with the content disposition set to attachment (Content-Disposition: attachment). The problem is due to a change in the way Flash Player handles the disposition. If it is set to attachment then it 'respects' that the file is intended for download and so the player doesn't play it. There is a discussion thread at the Adobe website that describes this, and the change is described in this security bulletin from Adobe.

Therefore with FileField as it stands it won't work with private files. I'm going to log this as a bug on the FileField project. The work around is to add a line of code to reset the disposition to inline for the flash mimetype (application/x-shockwave-flash).

At present I'm using

<?php
// Force to type inline if this is flash content
if (ereg('flash$', $file->filemime)) {
 
$disposition = 'inline';
}
?>

just after line 188

<?php
$disposition
= ereg('^(text/|image/)', $file->filemime) ? 'inline' : 'attachment';
?>