Kurz gesagt, du musst einen entsprechenden Header senden.
Ich hab grad keine Zeit das genauer zu erklären, sorry
Du kannst dir ja zu dem Thema mal was auf php.net durchlesen und für die kurzfristige Lösung deines Problems überlasse ich dir mal meine sendFile Funktion. Das ist mit Sicherheit nicht die Krone der Schöpfung, aber mir hat sie bisher ganz gute Dienste erwiesen.
PHP-Code:
function sendFile($file, $path = '/dein/pfad/zum/download/verzeichnis/')
{
// check whether someone tries to break out of the download folder
if (ereg("/", $file)) {
die('Downloads only allowed from download-folder!');
return false;
}
// set $file to the absolute path
$file = $path . $file;
// check whether the file exists
if (!file_exists($file)) {
die('The file does not exist!');
return false;
}
// set mime type and filename
$filesize = filesize($file);
if (function_exists(mime_content_type)) {
$filetype = mime_content_type($file);
} else {
$filetype = 'application/octet-stream'; // application/force-download
}
$filename = basename($file);
$file_extension = strtolower(substr(strrchr($filename, '.'), 1));
// start header
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Description: File Transfer');
header('Content-Type: ' . $filetype);
header('Content-Disposition: attachment; filename=' . $filename . ';');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . $filesize);
// send the file
readfile($file);
}