'."\n";
echo '
'."\n";
echo ''."\n";
}
// Change again to source directory.
chdir($oldpwd);
// Send a file.
function sendFile($file) {
// Check if file exists in current directory and it isn't this file.
if (file_exists($file) and strpos($file,"/") === false and $file !== basename(__FILE__)) {
header('Content-Type: ' . mime_content_type($file));
header('Content-Length: ' . filesize($file));
header('Content-Disposition: attachment; filename="' . $file . '"');
readfile($file);
}
}
// Warning: Don't left any character outside PHP code.