...

View Full Version : File downloading issues



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?

_Aerospace_Eng_
07-27-2007, 09:53 AM
You don't need readfile. Also I just tried it with readfile and the prompt is instant. I think your issue might be because you are using the absolute url. Have you tried using the relative path?

TrainReq
07-27-2007, 09:04 PM
The file i want it to download is off-site

rafiki
07-27-2007, 09:07 PM
why is it off-site, why cant you host it on your site?/server?

TrainReq
07-28-2007, 01:33 AM
I am making an mp3 file ripper which rips mp3s from another site..

firepages
07-28-2007, 09:54 AM
which unless you have permission form the site owner is probably a bad thing so we can't really help you further.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum