save($fn); //$xml = new XMLReader(); // Download the file for testing if (file_exists($fn)) { echo 'Prepare for download!!'; header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($fn)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($fn)); ob_clean(); flush(); readfile($fn); exit; } ?>