这是Flash播放页面
<html>
<head>
</head>
<body>
<embed autostart="true" src="download.php" loop="false" menu="true"
quality="high" height="356" width="564" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</body>
</html>
这是发送Flash的文件download.php:
<?php
$file = "file:///d:/work/123456/aa.swf";
if(!file_exists($file))
{
echo "对不起,此链接已经失效,请在下载页面上向我们报告,谢谢!";
exit;
}
ob_start();
$file_size = filesize($file);
header("Cache-control: private");
header("Content-Type: application/x-shockwave-flash");
header("Accept-Ranges: bytes");
header("Content-Length: ".filesize($file));
header("Content-Disposition: attachment; filename=\"flash.swf\"");
$fp = fopen($file, 'rb');
do
{
$data = fread($fp, 1024*1024);
if (strlen($data) == 0)
{
break;
}
echo($data);
}while(true);
fclose($fp);
?>