download file

来源:互联网 发布:淘宝助理关联店铺 编辑:程序博客网 时间:2024/06/05 06:03

 <?// set head

    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");;
    header("Content-Disposition: attachment;filename=$name");
    header("Content-Transfer-Encoding: binary ");

    //get file contents
    $tmp=file_get_contents('../pdf/'.$name);

    //out put file
   echo $tmp;
   exit;
?>