Microsoft Graph-通过C#保存文件附件? [英] Microsoft Graph - Saving file attachments through C#?
问题描述
是否可以通过Microsoft Graph API在C#中保存文件附件?
Is it possible to save file attachments in C# through Microsoft Graph API?
我知道我可以获取附件的属性( https://developer.microsoft.com/zh-cn/graph/docs/api-reference/v1.0/api/attachment_get )-我们也可以将其保存到某个位置?
I know I can get the properties of the attachment (https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/attachment_get) - can we also save it to a certain location?
推荐答案
获得附件属性后,它们将包含有关附件的信息.
When you get the attachment properties, they will contain information about the attachment.
有三个附件类型.
首先,检查属性"@odata.type
"中的附件类型,并进行相应处理.
First, check the attachment type in the properties' @odata.type
and handle them correspondingly.
对于fileAttachment
类型,它们包含contentLocation
属性,该属性为
For fileAttachment
types, they contain a contentLocation
attribute, which is the URI of the attachment contents.
您可以从URI下载附件.
You can download the attachment from the URI.
这篇关于Microsoft Graph-通过C#保存文件附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!