Page 1 of 1

fread problem

Posted: Wed Dec 29, 2004 10:36 am
by cdgore
I am having a problem with my fread line of my code. I have 2 pages. One is for the form and the other is for the message sent page. The form submits fine but when I attach a file and send it with the form, on the messege sent page I get this error:

Warning: fread(): Length parameter must be greater than 0. in /home/virtual/site205/fst/var/www/html/mysite_messageSent.php on line 100

My line 100 in my php code is this:



php:
--------------------------------------------------------------------------------
$data = fread($file,filesize($tmp_name));
?>

--------------------------------------------------------------------------------




Any ideas?

Posted: Wed Dec 29, 2004 10:43 am
by feyd
tried using [php_man]file_get_contents()[/php_man] instead?

Found problem

Posted: Wed Dec 29, 2004 10:45 am
by cdgore
I was testing a text file attachment with nothing, so it showed as 0 . Thanks for the help.