用PHP实现上载任何类型的文件
程序员文章站
2024-02-16 09:57:04
...
我这个程序可以让你上传任何类型的文件并可以直接显示或下载下来(upload_and_show.php3):
if($submit)
{
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("content-type:application/octet-stream");
header("content-disposition:inline;filename=$form_data");
header("content-description:php3 generated data");
$fd = fopen($form_data,"r");
while($string = fread($fd,200)){
echo $string;
}
fclose($fd);
}
else { ?>
if($submit)
{
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("content-type:application/octet-stream");
header("content-disposition:inline;filename=$form_data");
header("content-description:php3 generated data");
$fd = fopen($form_data,"r");
while($string = fread($fd,200)){
echo $string;
}
fclose($fd);
}
else { ?>
推荐阅读
-
用PHP实现上载任何类型的文件
-
用文本文件实现的动态实时发布新闻的程序_PHP
-
脚本语言 - A,B 两个文件,用PHP脚本实现按照一定格式将A中的内容输出到B中。php新手
-
用文本文件实现的动态实时发布新闻的程序_PHP
-
脚本语言 - A,B 两个文件,用PHP脚本实现按照一定格式将A中的内容输出到B中。php新手
-
PHP实现多文件上载的系统程序_PHP
-
用PHP实现动态产生XML文件以及从XML文件中抽取数据转化成HTML的小程序。。。不用DOM的。。_PHP教程
-
php如何实现把一个目录上的所有文件都上载上来
-
用php实现的下载css文件中的图片的代码
-
php下实现在指定目录搜索指定类型文件的函数_php技巧