写下载链接的时候,对于txt,doc,xls等文本类型的文件,点击链接时怎样才能直接下载,而不打开呢 <a href="www.xxx.com/download/yy.(txt or doc or xls)"></a>ie自动会下载的如果你装有flashget 或其他下载软件,他会连接到这些软件,来下载 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 file = fopen($file_dir . $file_name,"r"); // 打开文件 // 输入文件标签Header("Content-type: application/octet-stream");Header("Accept-Ranges: bytes");Header("Accept-Length: ".filesize($file_dir . $file_name));Header("Content-Disposition: attachment; filename=" . $file_name);// 输出文件内容echo fread($file,filesize($file_dir . $file_name));fclose($file);exit; Header("Content-type: application/octet-stream");Header("Accept-Ranges: bytes");Header("Accept-Length: ".filesize($file_dir . $file_name));Header("Content-Disposition: attachment; filename=" . $file_name);这些都是什么意思啊 能给个完整的说明吗?除了上面的类型,还有别的其他类型吗? $file = fopen($file_dir . $file_name,"r"); // 打开文件// 输入文件标签Header("Content-type: application/octet-stream");Header("Accept-Ranges: bytes");Header("Accept-Length: ".filesize($file_dir . $file_name));Header("Content-Disposition: attachment; filename=" . $file_name);// 输出文件内容fread($file,filesize($file_dir . $file_name));fclose($file);exit;我的文件是excel文件,怎么回事啊这样生成的结果是:Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 223Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 224Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 225Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 226邢唷?>? !?? ???\pJava Excel API BRa=??=h\:?8X@"?1?Arial1?Arial1?Arial1?Arial? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ @ +? @ )? @ ,? @ *? @ ? @ ?€?€?€?€?€?€`? first sheet,? ?? >% d褚MbP?_*+€%?"d,,??U> 鰁魰CPU峿弴s/2003-09-10 13:45:071.2%/2003-09-10 13:55:071.2%/2003-09-10 14:05:073.0%/2003-09-10 14:15:071.2%/2003-09-10 14:25:071.2%/2003-09-10 14:35:071.2%/2003-09-10 14:45:071.2%/2003-09-10 14:55:071.2%/ 2003-09-10 15:05:07 2.8%/ 2003-09-10 15:15:07 1.2%/ 2003-09-10 15:25:07 1.2%/ 2003-09-10 15:35:07 1.2%/ 2003-09-10 15:45:07 1.2%/2003-09-10 15:55:071.2%/2003-09-10 16:05:072.8%/2003-09-10 16:15:071.2%/2003-09-10 16:25:071.2%/2003-09-10 16:35:071.2%/2003-09-10 16:45:071.2%/2003-09-10 16:55:071.2%/2003-09-10 17:05:072.0%/2003-09-10 17:15:071.2%/2003-09-10 17:25:071.2%/2003-09-10 17:35:071.4%/2003-09-10 17:45:081.2%/2003-09-10 17:55:071.2%/2003-09-10 18:05:072.8%/2003-09-10 18:15:071.2%/2003-09-10 18:25:071.2%/2003-09-11 08:25:071.4%/2003-09-11 08:35:071.6%Db l*HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH !"#$%&'()*+,-./0123456789:;<=/ 2003-09-11 08:45:07 1.4%/!2003-09-11 08:55:07!1.6%/"2003-09-11 09:05:07"2.0%/#2003-09-11 09:15:07#1.4%/$2003-09-11 09:25:07$1.4%/%2003-09-11 09:35:07%1.6%/&2003-09-11 09:45:07&1.4%/'2003-09-11 09:55:07'1.2%/(2003-09-11 10:05:07(2.2%/)2003-09-11 10:15:07)1.2%/*2003-09-11 10:25:07*1.2%/+2003-09-11 10:35:07+1.8%/,2003-09-11 10:45:07, 如果有足够多的权限的话,修改服务器的配置是一个方法(如是apache服务器的话,修改httpd.conf)能解决问题 snprintf() 请教请教 关于php模版的一些问题. 哪位高手帮我看看我这个程序咋调试不出来 用PHPCMS系统,里面的PC标签晕晕的,谁指点下 求助 使用PHPExcel操作Excel2003时无法获取到worksheet php 获取拼音首字母的函数,有点小问题。指点迷津。 俺有这样一条sql php连接mysql不成功问题 第一个页面为用户资料页面,为修改一些内容,弹出一个窗口用form提交后这个窗口自动关闭,进入后台修改完成后,重新回到第一个资料页面窗 怎么让PHP执行一些自己输入的脚本 关于PHP打印的问题~~!在线等
// 输入文件标签
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($file_dir . $file_name));
Header("Content-Disposition: attachment; filename=" . $file_name);
// 输出文件内容
echo fread($file,filesize($file_dir . $file_name));
fclose($file);
exit;
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($file_dir . $file_name));
Header("Content-Disposition: attachment; filename=" . $file_name);
这些都是什么意思啊 能给个完整的说明吗?除了上面的类型,还有别的其他类型吗?
// 输入文件标签
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($file_dir . $file_name));
Header("Content-Disposition: attachment; filename=" . $file_name);
// 输出文件内容
fread($file,filesize($file_dir . $file_name));
fclose($file);
exit;我的文件是excel文件,怎么回事啊
这样生成的结果是:
Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 223Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 224Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 225Warning: Cannot add header information - headers already sent by (output started at c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php:10) in c:\Program Files\Apache Group\Apache\htdocs\hcycom\host\grid.php on line 226
邢唷?>? !?? ???\pJava Excel API BRa=??=h\:?8X@"?1?Arial1?Arial1?Arial1?Arial? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ ? @ @ +? @ )? @ ,? @ *? @ ? @ ?€?€?€?€?€?€`? first sheet,? ?? >% d褚MbP?_*+€%?"d,,??U> 鰁魰CPU峿弴s/2003-09-10 13:45:071.2%/2003-09-10 13:55:071.2%/2003-09-10 14:05:073.0%/2003-09-10 14:15:071.2%/2003-09-10 14:25:071.2%/2003-09-10 14:35:071.2%/2003-09-10 14:45:071.2%/2003-09-10 14:55:071.2%/ 2003-09-10 15:05:07 2.8%/ 2003-09-10 15:15:07 1.2%/ 2003-09-10 15:25:07 1.2%/ 2003-09-10 15:35:07 1.2%/ 2003-09-10 15:45:07 1.2%/2003-09-10 15:55:071.2%/2003-09-10 16:05:072.8%/2003-09-10 16:15:071.2%/2003-09-10 16:25:071.2%/2003-09-10 16:35:071.2%/2003-09-10 16:45:071.2%/2003-09-10 16:55:071.2%/2003-09-10 17:05:072.0%/2003-09-10 17:15:071.2%/2003-09-10 17:25:071.2%/2003-09-10 17:35:071.4%/2003-09-10 17:45:081.2%/2003-09-10 17:55:071.2%/2003-09-10 18:05:072.8%/2003-09-10 18:15:071.2%/2003-09-10 18:25:071.2%/2003-09-11 08:25:071.4%/2003-09-11 08:35:071.6%Db l*HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH !"#$%&'()*+,-./0123456789:;<=/ 2003-09-11 08:45:07 1.4%/!2003-09-11 08:55:07!1.6%/"2003-09-11 09:05:07"2.0%/#2003-09-11 09:15:07#1.4%/$2003-09-11 09:25:07$1.4%/%2003-09-11 09:35:07%1.6%/&2003-09-11 09:45:07&1.4%/'2003-09-11 09:55:07'1.2%/(2003-09-11 10:05:07(2.2%/)2003-09-11 10:15:07)1.2%/*2003-09-11 10:25:07*1.2%/+2003-09-11 10:35:07+1.8%/,2003-09-11 10:45:07,