philjoshua Posted February 9, 2009 Share Posted February 9, 2009 Hi, I'm just new with PHP. Can someone help me or give me advise about attaching a zip file with the form to be sent on email? Is it like, $fp = fopen($file,"rb"); $fcontent = fread($fp ,filesize($file)); fclose($fp); $content = chunk_split(base64_encode($fcontent)); $sep = strtoupper(md5(uniqid(time()))); $name = basename($file); but when I tried this, it returns a Warning: fread(): supplied argument is not a valid stream resource. ??? Thanks Link to comment https://forums.phpfreaks.com/topic/144444-attach-a-zip-file-in-an-email/ Share on other sites More sharing options...
ratcateme Posted February 9, 2009 Share Posted February 9, 2009 have a look at this pear package http://pear.php.net/package/Mail_Mime it is well documented and has support for adding attachments Scott. Link to comment https://forums.phpfreaks.com/topic/144444-attach-a-zip-file-in-an-email/#findComment-757946 Share on other sites More sharing options...
philjoshua Posted February 10, 2009 Author Share Posted February 10, 2009 have a look at this pear package http://pear.php.net/package/Mail_Mime it is well documented and has support for adding attachments Scott. Hi, I just want to ask how about if my form has a form confirmation, how will the attachment be detected or included on the confirmation page? ??? thanks Link to comment https://forums.phpfreaks.com/topic/144444-attach-a-zip-file-in-an-email/#findComment-758736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.