Return False on download

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
For the following code, can I get an opinion on what exactly the browser
will "do" or "receive" when the function returns false?

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Content-Length: " . filesize($val));
$filename = explode("/",$val);
$parts = count($filename);
header("Content-Disposition: attachment; filename=".$filename[$parts-1]);

function readfile_chunked($filename) {
 $chunksize = 1*(1024*1024); // how many bytes per chunk
 $buffer = '';
 $handle = fopen($filename, 'rb');
 if($handle === false) { return false; }
 while (!feof($handle)) {
  $buffer = fread($handle, $chunksize);
  print $buffer;
 return fclose($handle);


Re: Return False on download

On 11/7/2010 12:17 PM, Brian Smither wrote:
Quoted text here. Click to load it

Exactly what you sent - the headers and nothing else.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline