前台:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=UTF-8">
<title>Document</title>
</head>
<body>
<embed src="http://v.youku.com/v_show/id_XNzM1MDM3MDA4.html" width=200 height=200 autostart=true loop=true></embed>
</body>
</html>
下载处理:
<?php
if(!empty($_GET)){
header("Content-type: application/octet-stream charset=utf-8")//输出类型
header("Content-Disposition:filename={$name}")
header("Accept-Ranges: bytes")//文件单位
header("Accept-Length: {$filesize}")//文件大小
header("Content-Disposition: attachmentfilename=花朵.jpg")//下载时显示的名字
//文件下载的头部一些要求
//header("Content-type:application/octet-stream")
//按照字节大小返回
//header("Accept-Ranges:bytes")
//返回文件大小
//header("Accept-Length:$filesize")
//这里客户端的弹出对话框对应的文件名
//header("Content-Disposition:attachmentfilename=".$name)
//把文件名中含中文的文件先把文件名进行转码
//$file_name=iconv("utf-8", "gb2312", $name)
$name=$_GET['name']
$f=fopen($name, "r")
$buffer=1024
$filesize=filesize($name)
$downsize=0
$str=""
while(!feof($f) &&($filesize-$downsize)>0){
$downsize+=$buffer
echo fread($f,$buffer)
}
//echo $str
fclose($f)
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=UTF-8">
<title>Document</title>
</head>
<body>
<a href="download.php?name=b.jpg">下载b.jpg</a>
<a href="download.php?name=e.jpg">下载e.jpg</a>
</body>
</html>
准备两张b.jpg e.jpg图片即可都放在一个文件夹内
这个简单,但是有些繁琐,关键代码:$filename=“页面"
header("Content-type:application/vnd.ms-word")
header("Content-Disposition:attachmentfilename=".$filename.".xls")
echo "<table width='608' border='0' align='center' cellpadding='0' cellspacing='0'>"
...
需要保存的内容都用echo输出就OK了,你可以试试(我的是输出一个表格的例子)