What kind of string format? Just the plain text contents? That won't quite work with binary files*. Base64 encoding might be a better idea, it's what email uses most of the time for attachments. UUencoded might also work.
* Well it will probably work but the string will not be readable. It's not recommnended.