Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6754

Re: How to NOT send empty files via email?

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: How to NOT send empty files via email?
Date 2012-08-09 18:04 +0200
Message-ID <a8i5bhFsulU1@mid.individual.net> (permalink)
References <3dcfc489-6244-4920-a975-ab9db64ffe10@googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

How to NOT send empty files via email? pauly814@gmail.com - 2012-08-09 08:19 -0700
  Re: How to NOT send empty files via email? "J.O. Aho" <user@example.net> - 2012-08-09 18:04 +0200

csiph-web