readStream($file); // send the right headers header("Content-Type: " . $fs->getMimetype($file)); header("Content-Length: " . $fs->getSize($file)); header("Content-disposition: attachment; filename=\"" . basename($file) . "\""); // dump the attachement and stop the script fpassthru($stream); exit;