$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.

Recommended Answers

All 3 Replies

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.

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.

@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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.