Microsoft Graph-通过C#保存文件附件? [英] Microsoft Graph - Saving file attachments through C#?

查看:173
本文介绍了Microsoft Graph-通过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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆