You are here: How would I write MIME data back to a file? « PHP Language « IT news, forums, messages
How would I write MIME data back to a file?

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация