Closed GoogleCodeExporter closed 9 years ago
Now there are getAttachmentsFilenames() and getAttachmentsTypes() available.
They work in a similar way as getAttachments() does, returning an array of
values.
IMHO, there are too mucho functions to do essentialy similar tasks. It would
provably be better to have one function for returning a bi-dimentional array,
containing the attachments (or a file descriptors to them), their's
conetnt-types
and filenames. I don't know which attachment's header is more relayable for
this
matter, "name" or "filename".
Original comment by alkne...@gmail.com
on 3 Aug 2009 at 4:46
After thinking about it, I think all the headers should be available in
attachments. Some users may want to process other headers as well as their own
custom X-* headers.
I've committed a new class, MimeMailParser_attachment which models attachments.
So the new way of retrieving attachments is:
{{{
$attachments = $MimeMailParser->getAttachments();
foreach($attachments as $attachment) {
$filename = $attachment->filename;
$content = $attachment->content;
$content_type = $attachment->content_type;
$raw_headers = $attachment->headers;
// etc.
}
}}}
For some reason I couldn't add a commit log when committing those changes.
Original comment by buca...@gmail.com
on 3 Aug 2009 at 10:25
Other special case for double extension would be ".tar.bz2".
IMHO, getting the extension from the filename seems more like a generic string
function, not too much to do with e-mail parsing. For porpouse of
identification of
the file type, in the context of a e-mail message, usage of mime-type makes
much
more sense. In any case, no harm to have this functionality. Also, if there is
some
kind of .bash_profile or .forward file attached to a mail, this can be a mess.
Original comment by alkne...@gmail.com
on 4 Aug 2009 at 3:28
True true. I think we should remove the getExtension() function.
Original comment by buca...@gmail.com
on 4 Aug 2009 at 12:34
Fixed in r12
Original comment by buca...@gmail.com
on 8 Oct 2009 at 8:41
Original issue reported on code.google.com by
buca...@gmail.com
on 2 Aug 2009 at 7:35