Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET IMAP

 AfterLogic Forum : MailBee.NET IMAP
Subject Topic: Save Attachment Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 30 June 2009 at 8:52am | IP Logged Quote zedekiah

if ((part.Disposition != null &&
part.Disposition.ToLower() == "attachment") ||
(part.Filename != null &&
part.Filename != string.Empty) ||
(part.ContentType != null &&
part.ContentType.ToLower() == "message/rfc822"))
{
I want to save the attachment here

}
Back to Top View zedekiah's Profile Search for other posts by zedekiah
 
zedekiah
Groupie
Groupie


Joined: 24 June 2009
Location: United States
Online Status: Offline
Posts: 44
Posted: 30 June 2009 at 9:12am | IP Logged Quote zedekiah

I need to save it to a byte[] field in the database.

I have been using ContentStream to save it but I dont see that now.
Back to Top View zedekiah's Profile Search for other posts by zedekiah
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 01 July 2009 at 12:45am | IP Logged Quote Andrew

If I understood you correctly, you download envelopes with body structure from an IMAP server, check them for attachments and need to download attachments from the IMAP server and save them.

If yes, please refer to this documentation page. This sample there completely downloads all image files attached or embedded into the last message in the inbox, and saves them into C:\Temp folder. However, initially, attachment data is retrieved as a byte array and you can easily open a stream reader for that array.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide