TrainReq
07-27-2007, 09:50 AM
Well... I am running this function:
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="ha.mp3"');
readfile('http://www.site.com/blah.mp3');
To more/less make the browser prompt to download the mp3... however, readfile causes the PHP to server-side read the file THEN spit out the promt to download, i need a readfile alternative so instead of reading the file, it will just automatically promt to download the file. because do to this being an offsite mp3, it takes really long to read it.
if there is no readfile alternatives... can i do it in JS somehow?
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="ha.mp3"');
readfile('http://www.site.com/blah.mp3');
To more/less make the browser prompt to download the mp3... however, readfile causes the PHP to server-side read the file THEN spit out the promt to download, i need a readfile alternative so instead of reading the file, it will just automatically promt to download the file. because do to this being an offsite mp3, it takes really long to read it.
if there is no readfile alternatives... can i do it in JS somehow?