Posted by Shawn Wilson on 11/30/05 06:25
Say I have an email system grabbing email from a mail server and a message
has an attachment like a JPEG. It comes in as a big string of MIME encoded
data... how would I put that back together so it's a JPG again?
I can split out the message into it's parts ok, but once I have a string
like this: (this is truncated for space here)
------=_NextPart_000_002E_01C5F533.57C1E7F0
Content-Type: application/octet-stream;
name="avatar.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="avatar.jpg"
/9j/4AAQSkZJRYq7FXYq7FX/2Q==
------=_NextPart_000_002E_01C5F533.57C1E7F0--
If I have that stored in $attachment01, then what command would write it
back to a file named avatar.jpg and be a picture again?
Thanks in advance! Everyone is appreciated... I get a lot of help from you
guys.
--
Shawn Wilson
[Back to original message]
|