fread problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cdgore
Forum Newbie
Posts: 2
Joined: Wed Dec 29, 2004 10:35 am

fread problem

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

tried using [php_man]file_get_contents()[/php_man] instead?
cdgore
Forum Newbie
Posts: 2
Joined: Wed Dec 29, 2004 10:35 am

Found problem

Post by cdgore »

I was testing a text file attachment with nothing, so it showed as 0 . Thanks for the help.
Post Reply