You are here: Developer Forums » PHP & Email2HTTP » new

new

script (1)
Mar 2/08 20:01
this
Jamiro (1)
Mar 30/08 12:53
the sample php is not working I think ; instead of move it should be move_uploaded_file ???
TT (5)
Apr 12/08 18:12
You're right, and it has been updated - thank you
Steve Bullis (1)
Apr 30/08 21:12
This line should read
move_uploaded_file($attachment["tmp_name"],
"../files/" . $attachment["name"]);
not

move_uploaded_file($attachment["tmpname"],
"../files/" . $attachment["filename"]);


Working Script:

<?php

// Save each attachment from the message to disk
foreach ($_FILES as $attachment)
{
move_uploaded_file($attachment["tmp_name"],
"../files/" . $attachment["name"]);
}

// Send a reply back to the sender by email
// by simply producing some output
$numberOfFiles = sizeof($_FILES);
echo "Thank you, my friend. I have received your "
. $numberOfFiles . " files."
. "\r\n\r\n---Original message---\r\n"
. $_POST["body"];

?>
TT (5)
May 2/08 08:25
Thanks Steve, we will update that right away
Posts 1 - 5 of 5
Copyright © 2006-2008 Trevose Consultants Ltd.
Contact us | Terms of Use