'downloads', 'css' => ['mirror.css'], ]; // Find out what is the exact file requested $file = false; foreach ($possible_files as $name) { if (@file_exists($_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $name)) { $file = $name; break; } } // Print out common header site_header('Get Download', $site_config); echo '
'; $size = 0; // No downloadable file found if ($file === false) { $info = "

The file you requested (" . htmlspecialchars($df, ENT_QUOTES, "UTF-8") . ") is not found on this server ({$MYSITE}).

"; echo <<Download not found {$info} EOT; } else { // Set local file name $local_file = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $file; // Try to get filesize to display $size = @filesize($local_file); } ?>