如题,各位同道给个建议吧,有代码更好

解决方案 »

  1.   

    下载路径可以在浏览器中自动定义
    $file = 'ASDFGgg.pdf';
    _Download("files_dir/".$file, $file);function _Download($f_location,$f_name){
         header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
       header('Content-Description: File Transfer');
       header('Content-Type: application/octet-stream');
       header('Content-Length: ' . filesize($f_location));
       header('Content-Disposition: attachment; filename=' . basename($f_name));
       readfile($f_location); 
     }