Re: mimeDecode.php attachments content-id
| From: | Alexandre Suter | Date: | Sat, 23 Mar 2002 18:36:36 +0000 |
| Subject: | Re: mimeDecode.php attachments content-id | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1037@lists.php.net to get a copy of this message | ||
In fact the key content-id is present in the headers array, but it has not any
value... Maybe this comes from the fact that the case "content-id" is not
present in the following switch (mimeDecode.php). By using print_r on the
array returned for one attachment that had one content-id set in its header
(by looking at the mail's source) I could find values assigned to
'content-type','content-disposition' and 'content-transfer-encoding',
but not
for 'content-id' in the array returned by _decode()
Thanks for your help,
while (list($key, $value) = each($headers)) {
$headers[$key]['name'] = strtolower($headers[$key]['name']);
switch ($headers[$key]['name']) {
case 'content-type':
$content_type =
$this->_parseHeaderValue($headers[$key]['value']);
if (preg_match('/([0-9a-z+.-]+)\/([0-9a-z+.-]+)/i',
$content_type['value'], $regs)) {
$return->ctype_primary = $regs[1];
$return->ctype_secondary = $regs[2];
}
if (isset($content_type['other'])) {
while (list($p_name, $p_value) =
each($content_type['other'])) {
$return->ctype_parameters[$p_name] = $p_value;
}
}
break;
case 'content-disposition';
$content_disposition =
$this->_parseHeaderValue($headers[$key]['value']);
$return->disposition = $content_disposition['value'];
if (isset($content_disposition['other'])) {
while (list($p_name, $p_value) =
each($content_disposition['other'])) {
$return->d_parameters[$p_name] = $p_value;
}
}
break;
case 'content-transfer-encoding':
$content_transfer_encoding =
$this->_parseHeaderValue($headers[$key]['value']);
break;
}
}
Richard Heyes wrote:
> > Could someone explain me why the content-id of attachments is not
> > parsed by
> > the mimeDecode class this information would be very usefull in order to
> > display html messages containing attached images.
>
> Parsed in what way? The content id will be available as one of the headers.
>
> --
> Richard Heyes
> "If you have any trouble sounding condescending,
> find a Unix user to show you how it's done." - Scott Adams