Clean the code for download.php