简体   繁体   中英

String value that represents an email attachment, how to store to disk/db?

Ok it turns out this 3rd party component I am working with stores an email attachment in a property of string type (it is already decoded).

How would I store this to file now?

It has: filename, encodingtype and the string representation of the file.

Open a file using a StreamWriter/TextWriter class and call the .Write method. Alternatively you can base64 encode it with Convert.ToBase64String first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM