views:

30

answers:

1

So I have decrypted a file and am left with a byte array containing this (Uni-encoded):

Content-Type: text/plain;
    name="testfile.txt"
Content-Transfer-Encoding: binary
Content-Disposition: attachment;
    filename="testfile.txt"

My super secret message.

Where "My super secret message." is the contents of the file, which could be any time of file contents (Word, Excel, etc.). What would be the best way of parsing this information and writing the original file back to the drive?

Is it possible that this binary data is actually an email attatchment? How would I go about re-creating the email attachment then pull out the original file?

+1  A: 

Perhaps this MIME parser will help:

http://www.codeproject.com/KB/cs/mime_project.aspx

Qwertie