using php to download files, not working on large files? [duplicate]

PHP has limits on how long a script can run, and how much memory it can use. It's possible that the script is timing out before it has completed, or is using up too much memory by reading in the large file.

Try tweaking the max_execution_time and memory_limit variables in php.ini. If you don't have access to php.ini, try the set_time_limit and/or ini_set functions.


I see you're using ob_clean. If you have output buffering enabled, try disabling it (e.g. by replacing the ob_clean call with ob_end_clean).