Yep, I did a print_r on all the global arrays just to make sure the files weren't hiding in some unexpected place and as I said the $FILES and $POST arrays were completely empty.
There's quite a lot of code involved to build and send the post, but the salient points are:
The code to post the request is:
$aParms["Action"] = "process";
$strFile = funGetFile("(path_to_images)images/image.gif");
$aImages[] = array("body" => $strFile
,"name" => "image.gif"
,"c_type" => ""
);
$strFile = funGetFile("(path_to_test)test/test.txt");
$aAttachments[] = array("body" => $strFile
,"name" => "test.txt"
,"c_type" => ""
,"encoding" => ""
);
$objPost = new http();
$objPost->Connect($strHost);
$strStatus = $objPost->Post("(test_path)formdatapost.php", $aParms, $aImages, $aAttachments);
$objPost->Disconnect();
if ($strStatus == 200):
$strBody = $objPost->getBody();
else:
$strBody .= BR . "There was a problem posting the data. The error message returned was:" . BR . $objPost->getStatus() . " - " . $objPost->getStatusMessage();
endif;
The code to receive the request is:
$strTargetImg = "(test_path)formdatatest/" . $_FILES[0]["name"];
$strTargetAtt = "(test_path)formdatatest/" . $_FILES[1]["name"];
$booImgWorked = funCopyUploadedFile($_FILES[0], $strTargetImg);
$booAttWorked = funCopyUploadedFile($_FILES[1], $strTargetAtt);
$strBody = BR . "The action requested was: $pstAction";
$strBody .= BR . "The image sent was: " . $_FILES[0]["name"];
$strBody .= BR . "<img src=\"(url_path) . $_FILES[0]["name"]\">" . BR;
$strBody .= BR . "The attachment sent was: " . $_FILES[1]["name"];
$strBody .= BR . funGetFile($strTargetAtt);
echo $strBody;
This http class just formats the request and sends it. It calls another class which formats the mime message, which I included in my first post. The POST bit does work as the text in $strBody is passed back and displayed perfectly OK, it's just that the files aren't appearing anywhere at the other end, so they can't be saved and so don't appear in the message.
Because of this, I suspect the problem perhaps lies somewhere in the format of the mime message or the way I need to accept it on the receiving end.
My main problem is that I'm not sure how the data is presented at the receiving end. I assumed it would be the same as when you submit a form i.e. the file details are automatically presented in the $_FILES global, but when that didn't happen, I didn't know where to turn.
Debbie-Leigh