php实现下载代码

php实现下载代码

php实现下载代码

  1. $NomFichier = basename($filename);
  2. $taille=filesize($filename);
  3. ob_end_clean();
  4. header("Content-Type: application/force-download; name=\"$NomFichier\"");
  5. header("Content-Transfer-Encoding: binary");
  6. header("Content-Length: $taille");
  7. header("Content-Disposition: attachment; filename=\"$NomFichier\"");
  8. header("Expires: 0");
  9. header("Cache-control: private");
  10. header("Pragma: no-cache");
  11. readfile($filename);

你可能感兴趣的:(PHP,cache)