Skip to content

Instantly share code, notes, and snippets.

@felipezarco
Created May 24, 2019 14:49
Show Gist options
  • Save felipezarco/b2d5b8ab62cbfecd92a5f190d221c29d to your computer and use it in GitHub Desktop.
Save felipezarco/b2d5b8ab62cbfecd92a5f190d221c29d to your computer and use it in GitHub Desktop.

Revisions

  1. Luiz Felipe Zarco created this gist May 24, 2019.
    12 changes: 12 additions & 0 deletions header_force_download_audio.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($destination_name_ulaw));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');
    header('Content-Length: ' . filesize($destination_name_ulaw));
    ob_clean();
    flush();
    readfile($destination_name_ulaw);
    exit();