Thank you. Will look into it.
On Mon, Jul 31, 2017 at 1:17 AM, Gulácsi Tamás wrote:
> If you can decod partially, then Read from the Body and Write to the file.
> If it is more complec, then see golang.org/x/text/encoding.Transformer
>
> jesse junsay
If you can decod partially, then Read from the Body and Write to the file.
If it is more complec, then see golang.org/x/text/encoding.Transformer
jesse junsay ezt írta (időpont: 2017. júl. 30., V
19:11):
> Hi Guys,
>
> Last week finally was able to resolve my issue. After
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,
@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 wrote:
> You only need to decode the
You only need to decode the Transfer-Encoding, and treate the file as
Content-Type says.
jesse junsay 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
On Wed, Jul 26, 2017 at 02:52:05PM +0800, jesse junsay 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.
> Thank you Tamas... I am already
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
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 the Google Groups
"golang-nuts" group.
To
Yes, I've actually tried doing that... but resulting file is gibberish... I
might have not done the decoding correctly... Anyway... Thank you...
On Wed, Jul 26, 2017 at 1:03 PM, andrey mirtchovski
wrote:
> I have not done this. It seems relatively easy given the boundary
I have not done this. It seems relatively easy given the boundary
delimiter and some of the mime header information to pick out the file
contents by searching forward through the []byte to a delimiter and
writing the contents from there to the next delimiter to a file, but I
have not done this.
Hi Andrey,
I was wondering if you have a sample on how to extract the attachment from
email and save it to disk/file. I tried reverse engineer the sample code of
attaching attachments into an email but cant figure out what to do with the
[]byte.
Have you tried doing this before? Just the
Hey Andrey!!!
That worked, thank you for your example. At least that cleared that part
out in my mind. And all those other parts like the multipart. Makes sense
now. Learned a lot too...
Thank you very much I really appreciate it... It already took me more than
a week. My first time working on
the example you have given is incomplete, but the most likely reason
you're not being successful is that you are not setting correctly
headers for multipart/mixed mime types. i've created a full working
example here, hopefully this helps:
https://play.golang.org/p/xVqUDN7OGt
for more info on
Hi Andrey,
Thank you. I have been trying to figure out how to use your example. But
the email that I receive from it are plain text even the encoded attached
file. It does not appear as attached but as encoded characters in the mail
body. And there is still no attachment seen. I tried
Hi Andrey,
Thank you. I have been trying to figure out how to use your example. But
the email that I receive from it are plain text even the encoded attached
file. It does not appear as attached but as encoded characters in the mail
body. And there is still no attachment seen. I tried modifying
the code below which gzips and attaches a file to an email io.Writer
has worked for me for close to 5 years. it's not idiomatic go code so
don't use it verbatim, only as an example.
the boundary is something random the client chooses. i use a sha256
baked into the client. the same for every
16 matches
Mail list logo