コード例 #1
0
ファイル: functions.php プロジェクト: phpf/http
 /**
  * Sends a file download, invoking the browser's "Save As..." dialog.
  *
  * Exits after sending. Unlike the HTTP extension version, this function
  * also sends Content-Type, Content-Disposition, and "no-cache" headers.
  *
  * @param string $file Filepath to file to send.
  * @param string $filetype File type to send as, default is 
  * 'application/octet-stream'.
  * @param string $filename Optional name to show to user - defaults to
  * basename($file).
  * @return void
  */
 function http_send_file($file, $filetype = 'download', $filename = null)
 {
     Util::sendFile($file, $filetype, $filename);
 }