Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Translating cid: image src to real filename

by cfreak (Chaplain)
on Jul 28, 2003 at 17:58 UTC ( #278523=perlquestion: print w/ replies, xml ) Need Help??
cfreak has asked for the wisdom of the Perl Monks concerning the following question:

Forgive me monks for asking a silly question but I can't seem to find an answer anywhere on this site or google.

I'm writing yet another web-mail client to learn and because I need something more customizable than what I'm finding already availiable. So far things have gone pretty well but I'm having trouble displaying inline images. When I receive an HTML email I try to parse it and map any images that have src="cid:<something here>" to the actual filename that is attached to the email. The problem is that the cid field doesn't seem to contain the actual filename rather, what looks like a hex string with some dollar signs etc. I assume that this information is with the actual attachment somewhere but I can't seem to figure out how to get it. I'm using MIME::Parser to parse the emails and the only filename information I can seem to get is:

$entity->recommended_filename(); # gets the real file-name

Or:
$entity->bodyhandle()->path(); # gets the internal name used by MIME:: +Parser in the tmp directory

Can someone tell me what I'm missing?

Thanks in advance!

Lobster Aliens Are attacking the world!

Comment on Translating cid: image src to real filename
Select or Download Code
Re: Translating cid: image src to real filename
by cleverett (Friar) on Jul 28, 2003 at 18:02 UTC
    What does $entity->filename()return?

    UPDATE: also, are you sure you're sending it with a filename?

        Are you looping through the result of $msg->parts(), and then do you check for an image something like $part->type() =~ m#^image/\w+#?
Re: Translating cid: image src to real filename
by Thelonius (Curate) on Jul 28, 2003 at 19:20 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://278523]
Approved by blue_cowdawg
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-07-10 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls