Home > php教程 > php手册 > 例子:用PHP实现上载任何类型的文件并可以直接显示或下载下来

例子:用PHP实现上载任何类型的文件并可以直接显示或下载下来

WBOY
Release: 2016-06-21 09:08:13
Original
1027 people have browsed it

下载|显示

我这个程序可以让你上传任何类型的文件并可以直接显示或下载下来(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 { ?>
      


      file description:

      
      
      
file to upload/store in database:

      
      


        


  


 



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template