The I had this problem solved, but it isn't. Still having a problem with downloaded files having the wrong md5sum. I've scrubbed the script again to be sure there aren't any tabs or blank spaces following the commands. Also no php errors. Here's the code.
<?PHP
error_reporting(E_ALL);
ini_set('display_errors', '1');
function mydloader($filename=NULL) {
if (isset($filename)) {
$filename = preg_replace("/\s+/u", " ", $filename); // Make sure no hidden characters in filename
$ext = pathinfo($filename, PATHINFO_EXTENSION);{ // Get file extension
if ($ext == '.iso')
header('Content-Type: application/x-cd-image');
elseif ($ext == '.gz')
header('Content-Type: application/zip');
else
header('Content-Type: octet-stream');}
header("Content-Disposition: attachment; filename={$filename}");
header('Pragma: no-cache');
header('Expires: 0');
readfile($filename);
}
else {
echo "isset failed";
}
}
mydloader($_GET["f"]); // Filename passed from calling script
I'm totally confused as to why this isn't working correctly. I spent the entire weekend trying go get this working so I'd really appreciate some help on this.