PHP-Code:
<?php
if (isset($_GET['los'])) {
ob_start();
error_reporting(E_ALL);
$download = $_GET['los'];
$filelist = array("download" => 'phpde.zip');
// wo das Scropt Liegt, befindet sich auch die pphpde.zip
if (!isset($filelist[$download])) die('Datei $download nicht vorhanden.');
$basedir = "";
$filename = $filelist[$download];
header('Content-Type: application/zip');
$gross = filesize($filename);
header('Content-Length: "'.$gross.'"');
$save_as_name = basename($filelist[$download]);
header('Content-Disposition: attachment; filename = '.$save_as_name.'');
if(is_readable($filename))
{
echo file_get_contents($filename);
} else {
echo "";
}
ob_flush();
die();
}
?>
<a href="?go=mich&los=download">Downloadstart</a>
Kommentar