Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: How to NOT send empty files via email? Date: Thu, 09 Aug 2012 18:04:00 +0200 Lines: 20 Message-ID: References: <3dcfc489-6244-4920-a975-ab9db64ffe10@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ot4u1SywtskfUyl541eB5Qpj/0dJAv+/d9ymaGji+Qig+eVWeAICYGBZhc4qAw3GIJ Cancel-Lock: sha1:wN7NzuKNIvP73Geg+ED9nw2h9jk= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120807 Thunderbird/14.0 In-Reply-To: <3dcfc489-6244-4920-a975-ab9db64ffe10@googlegroups.com> Xref: csiph.com comp.lang.php:6754 On 09/08/12 17:19, pauly814@gmail.com wrote: > Hi, > I have a simple php page that grabs a .txt file if it exists and emails it. In your example you don't. > I would like to modify it so that if the file is under 60 bytes, dont send it. > > Here is what I am doing to send the file: > $messageBody .=file_get_contents("d:\notes\note $filedate.txt"); > $messageBody .= "\n\r==============================================================\n\r"; > $messageBody .=file_get_contents("d:\notes\middaynote $filedate.txt"); Check the size of what you get from file_get_contents() of use function like filesize() -- //Aho