Hi Guys, Last week finally was able to resolve my issue. After looping through the parts and determining which are attachments. All I just need to do is read the file into io.Reader type then decode it and convert it back to []byte and write to file.
b64 := base64.NewDecoder(base64.StdEncoding, typeIOReader) // Decode err = ioutil.WriteFile(filename, StreamToByte(b64), 0644) if err != nil { log.Fatal(err) } I am not sure if this is the most efficient way of doing this. Would be glad for any suggestions. Thanks guys... On Wed, Jul 26, 2017 at 7:03 PM, jesse junsay <jessej3...@gmail.com> wrote: > @Konstantin K. - Yes been doing that. Have you successfully done this > problem before? > > @Gulacsi - That's where I am right now. > > Thanks guys. Will let you know if I figure this out... > > On Wed, Jul 26, 2017 at 5:30 PM, Gulácsi Tamás <tgulacs...@gmail.com> > wrote: > >> You only need to decode the Transfer-Encoding, and treate the file as >> Content-Type says. >> >> >> jesse junsay <jessej3...@gmail.com> ezt írta (időpont: 2017. júl. 26., >> Sze, 8:52): >> >>> Thank you Tamas... I am already done with identifying each part using >>> the mime multipart... My main issue now is decoding it back to its binary >>> form and save it to disk... each attachment to its own data format. jpg >>> attachment to file.jpg, pdf attachment to file.pdf and txt attachment to >>> file.txt... >>> >>> On Wed, Jul 26, 2017 at 1:35 PM, Tamás Gulácsi <tgulacs...@gmail.com> >>> wrote: >>> >>>> Check out github.com/tgulacsi/agostle - it walks the tree of mime >>>> parts of mail and converts everything to PDF, but you need the walk part >>>> only - which uses mime/multipart reader basically. >>> >>> >>>> >>>> -- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "golang-nuts" group. >>>> To unsubscribe from this topic, visit https://groups.google.com/d/to >>>> pic/golang-nuts/nfJyUx3BVvs/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> golang-nuts+unsubscr...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.