Right, I am trying to create a mail message to which I want to attach a jpeg image which I have retrieved from an Oracle database. The column type is BLOB and I am using MIME to set up the mail. Please note that the filename is not related to the image.
However, nothing seems to get attached?
here is the code to retrieve the data and set up the message.
$query = "SELECT P.PI_FILENAME, P.PI_LOW_IMAGE FROM $picturesTable P, $goodsPicturesTable GP
WHERE GP.PICTURE_ID = P.PICTURE_ID
AND GP.GOODS_ID = $goodsId
AND P.DELETED_IND = 0";
/ Build up the attachment list /
$j=1;
$goodsList .= "Picture Names :- ";
while (@OCIFetchInto ($curser, &$values)) {
$displayed = true;
$picFileName = sprintf("%s",$values[0]);
$imageData = $values[1];
$attachList = "Content-Type:image/jpeg; name=". $picFileName . "\n";
$attachList .= "Content-Disposition:attachment\n\n";
$attachList .= $imageData . " \n";
$attachList .= "--" . $boundary . "--\n";
$goodsList .="$j. $picFileName ";
$j++;
}
later on I assign the $message to $attachList