0

I've got a simple code

 header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename="' . basename($file_name).'"');
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: no-cache');
    header('Content-Length: ' . filesize($file_name));
    echo ('test');
    ob_clean();
    flush();
    readfile($file_name);
    //var_dump($file_name);
    //unlink($file_name);
    exit;

But when I'am trying to download file via FF (latest 63 version) it won't download anything. When I look through Fiddler, I saw that there was no actual content, headers only. But from time to time, file downloads somehow. Chrome works well anytime. What could it be? Thank you for your time.

P.S. Running on XAMPP on windows 7 x64

Alex Petrov
  • 75
  • 10
  • Turn on Error reporting to find it out: https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – ino Nov 29 '18 at 09:24
  • I debugged script via Xdebug. Everything looks fine, and file downloads OK via Chrome, But FF have troubles. – Alex Petrov Nov 29 '18 at 09:27

0 Answers0