КодPHP функция загрузки не работает
public static function download($file, $type = 'application/octet-stream') {
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: ' . $type);
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
die();
}
}
Firefox & Chrome и с той же проблемой
Любая помощь будет полезным.
Спасибо
thats некоторое сообщение об ошибке ... – DevDonkey
может кто-нибудь объяснить мне, почему я получил проголосовать? –
Это не ошибка. Это содержимое файла. – Justinas