Improvement for files with spaces within filename:
added quotes to header filename=...
Improvements for downloads of large files:
set_time_limit(0) prevent PHP from stopping the process
ob_end_flush() clear PHP buffer
session_write_close() stops blocking the session file of PHP. Without this, the user can't visit another page of the same website during download (see: http://konrness.com/php5/how-to-prevent-blocking-php-requests/ )
Remark: Apache Config has to be changed as well e.g.
<IfModule mod_fcgid.c>
    FcgidBusyTimeout 3600
</IfModule>