Comments (1)
case FileAttachment fa:
try
{
await fa.Load();
using (var ms = new MemoryStream(fa.Content))
{
var fileLocation = await SaveAttachmentFile(ms, path, fa.FileName ?? fa.Name);
renameResults.Add(attachment.ContentId ?? attachment.Name, fileLocation);
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"Something went wrong saving File Attachment {fa.FileName ?? fa.Name}");
}
break;
case ItemAttachment ia:
try
{
// Load Item with additionalProperties of MimeContent
await ia.Load(ItemSchema.MimeContent);
// MimeContent.Content will give you the byte[] for the ItemAttachment
// Now all you have to do is write the byte[] to a file
if (ia.Item != null)
{
using (var ms = new MemoryStream(ia.Item.MimeContent.Content))
{
var fileName = ia.Name + ".eml";
var fileLocation = await SaveAttachmentFile(ms, path, fileName);
renameResults.Add(attachment.ContentId ?? attachment.Name, fileLocation);
}
}
}
catch (Exception ex)
{
_logger.LogWarning(ex, $"Something went wrong saving File Attachment {ia.ContentId ?? ia.Name}");
}
break;
}
from ews-managed-api.
Related Issues (20)
- Authentication problem HOT 1
- AutodiscoverUrl error HOT 1
- Using basic authentication HOT 1
- Autodiscover Error in Windows UWP app HOT 1
- Any plans for strong naming the assembly?
- TimeZone issue HOT 1
- An unsupported mechanism was requested. NTLM authentication requires the GSSAPI plugin 'gss-ntlmssp' HOT 2
- Can you create a library with a different name and a different space name?
- EWS on MacOS and Linux 401 Unauthorized error!
- Unable to download FileAttachment HOT 18
- MIT License in nuget.org
- Strong naming? HOT 1
- Null Reference exception HOT 1
- [Docs] Best practices for instantiating ExchangeService? (DI Lifetime) HOT 1
- Streaming Connections consuming considerable CPU time HOT 1
- Autodiscover with WebCredentials on (non-windows) fails HOT 1
- FindItems will not recognize AQS search string with category HOT 2
- the format of value 'bearer ' is invalid HOT 1
- Invalid transition. A period with the specified Id couldn't be found
- Recall a sent message
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ews-managed-api.