Hey. Im trying to send a .swf file through php. Ive done this in a similar way for images but cannot figure out what the header types are for .swf files.
This is what i have so far, but it does not seem to work:
$file = "$root\\www\\spaceArenalClient.swf";
//First, see if the file exists
if (!is_file($file)) { die("
<b><p>The file you tried to access does not exist.<br />
Since I, the admin, of this place make no mistakes<br />
it is obviously you whom is at fault....
</p></b>");
}
//Gather relevent info about file
$len = filesize($file);
$filename = basename($file);
$file_extension = strtolower(substr(strrchr($filename,"."),1));
//Begin writing headers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
//Use the switch-generated Content-Type
header("Content-Type: application/octet-stream");
//Force the download
$header="Content-Disposition: attachment; filename=".$filename.";";
header($header );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$len);
@readfile($file);
exit;
any help appreciated , thanks
//Woka