0
$fp = "http://".$site."/stor10392/".$filename;
	  $complete = file_get_contents($fp);
	  
	  header("Expires: 0");
	  header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
	  header("Content-type: ".$mimetype);
	  header("Pragma: public");
	  header("Content-Disposition: attachment; filename=\"".$filename."\"");

	  echo $complete;

this is code from my download script

this making save box from browser taking too long to appear .. (30-40sec on 50mb file)

anyone know how to make it fast?

ps: if you need full code please let me know.

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by darjana
0

Guess it takes PHP so long to fetch the data from the file. Try to put the function file_get_contents() after the header-modification.
Don't know if thats the problem but tell me anyway if it worked or not.

0

It depends on the site that you are trying to retrieve content. If the site is loading slow, then it can affect on your retrieval of content.

0

@sDJH, its same slow loading.

I tried replacing the function file_get_contents with readfile, its working fast and fine on firefox but however on iex its downloading 0bytes file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.