FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Force Downloading From Another Server bandwidth issues?





Dougie1
OK. I have a code which force downloads files from other sites. I am not sure what the code does though. Does the code Download the file to my site then the user downloads from my site hence using up my bandwidth or does it simply alter the headers and download from that site.

I really don't want this script soaking up my bandwidth so I need to know this.
Code:

$myfile = "http://www.anothersite.com/largefile.txt";
   header("Cache-Control: public, must-revalidate");
   header("Content-Type: " . $mm_type);
   header('Content-Disposition: attachment; filename="'.$filename.'"');
   header("Content-Transfer-Encoding: binary\n");

   readfile($myFile);
Ranfaroth
It will use your bandwidth.
Dougie1
Ranfaroth wrote:
It will use your bandwidth.

Crap. So it does. I remember, readfile reads the whole file and puts it on your page. That is really annoying.

Is there any other way to do this because this is using up my bandwidth and the site that it is getting it from. I know I could just change the header to Location: but I need to alter the name of the file so is there any way to do this.

Thanks.
Related topics
Interview: Derek Liu, Gaia Online Anime Community
FTP Program of choice
Justification for War in Iraq
connecting to another server
3 questions
Yet another server down thread (YASDT)
IRC applet to another server.
Redirect to Post -Saving Server Bandwidth !!
Battlefield 2: 1.4 Patch is out!
Out Of Bandwidth
Call of Duty 2 server question
Any fast way to transfer/backup a domain to another server?
Server Two Issues [resolved]
Direct Download to server
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.