Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: Downloading strangeness: downloaded file has no content Date: Sun, 2 Oct 2022 12:14:13 +0200 Lines: 41 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 06pBNzTmOwoyUnH0eVX3gA/x9c0mzJp7sSVH94LNgdxbEIe++a Cancel-Lock: sha1:2L1meklXQZn/Rr9WNodWqcNlEWM= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US-large In-Reply-To: Xref: csiph.com comp.lang.php:19126 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. >>> readfile ($file); By the way, what value does the redfile return? Also do you get an exception? Could also be got to check the file exists and can be read If(file_exists($file)) is_file($file)) { if(is_file($file)) { if(is_readable($file)) { try { $retval = readfile ($file); // log the retval to your logfile } catch (Exception $ex) { //log the exception here } } else { // log that file not readable } } else { // log file not really a file, most likely a directory } } else { // log the file do not exists } -- //Aho