write to a file

From: Date: Wed, 18 Apr 2001 08:28:11 +0000
Subject: write to a file
Groups: php.general 
Request: Send a blank email to php-general+get-49173@lists.php.net to get a copy of this message
Hi I have the following code $fp=fopen($agentcode.date("m-d-Y-g-i-s").'CyberTrac.ctr', "w"); fwrite($fp,"$agentcode etc etc"); $fc = fopen($fp, 'rb'); $attachment = fread($fc , filesize($filename)); fclose($fc); $mail = new html_mime_mail('X-Mailer: Html Mime Mail Class'); $mail->add_attachment($attachment, $agentcode.date("m-d-Y-g-i-s").'CyberTrac.ctr', 'application/octet-stream'); The file is successfuly created. When it is attatched to the email however the size is written as 0 bytes, the filename is the same though. If I check the file on the server side it s perfectly ok, any ideas? TIA Wade

« previous php.general (#49173) next »