Thanks , I got it working , the one error you were still getting was because of line 105:
elseif (!empty($_POST[‘do’]) && ($_GET[‘do’] == ‘download’)) {
I changed it to…
elseif (!empty($_GET[‘do’]) && ($_GET[‘do’] == ‘download’)) {
The JAvascript error “Uncaught SyntaxError: Unexpected token >” was being caused by the 2nd line in the Javascript:
var MAX_UPLOAD_SIZE = <?php echo $MAX_UPLOAD_SIZE ?>;
Even though the code is badly written in your opinion, I will stick with it. Thanks for cleaning up the code (somewhat)