Using filefield to allow an administrator to upload .swf files. Flash (.swf) files are to be viewed by the end user in the browser, via a specialized template which requests the file vie javascript. Using private files ( 'system/files' request ). Currently, the .swf file does not play as the Content-Disposition is set to 'attachment' instead of inline. If the file is requested directly (outside of its template), the browser prompts to download.
For a fix, add to filefield_file_download just after the text or image disposition is set.
if ( $file->filemime == 'application/x-shockwave-flash' )
$disposition = 'inline';
Comment | File | Size | Author |
---|---|---|---|
#1 | filefield_flash_inline.patch | 849 bytes | quicksketch |
Comments
Comment #1
quicksketchStrange this fix must have only been committed to the Drupal 5 version somehow. I've reapplied the fix from #325795: Content-Disposition: attachment breaks swf content to the Drupal 6 version which should fix this problem.