Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Tim Streater Newsgroups: comp.lang.php Subject: Re: Downloading strangeness: downloaded file has no content Date: 2 Oct 2022 15:57:25 GMT Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=fixed Content-Transfer-Encoding: 8bit X-Trace: individual.net jnIf3gr08QGJr3dYrEloUwhiRGqIT6t+h6/3je/8iBYOXrv1IB Cancel-Lock: sha1:U3w6GSd+5gcCxzwIRqZwpBoEmYU= X-No-Archive: Yes User-Agent: Usenapp for MacOS X-Usenapp: v1.23/l - Full License Xref: csiph.com comp.lang.php:19127 On 02 Oct 2022 at 11:14:13 BST, "J.O. Aho" wrote: > On 01/10/2022 21.44, Tim Streater wrote: > >>>> ob_clean (); > > This will just clean out the output buffer, so the max size would then > be limited of the buffer size, think you need to switch to use > ob_end_clean() which disables the output buffer and is recommended in > the php documentation for readfile. This solved the problem. >>>> readfile ($file); > > By the way, what value does the readfile return? > Also do you get an exception? I think I must have got a real error or exception at this point, as code after the readfile to check the readfile return and also compare with filesize() was not executed. I've not heard back from the hosting provider at this point. Thanks for your help. -- "The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he who, by peddling second-rate technology, led them into it in the first place." - Douglas Adams