大 (> 4mb) 文件附件 [英] Large (> 4mb) File Attachments

查看:25
本文介绍了大 (> 4mb) 文件附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Microsoft Graph API,可以将文件附件添加到消息中,如 这里.但是,由于 REST 请求的总大小限制为 4mb,这不允许非常大的附件.

Using the Microsoft Graph API, it is possible to add file attachments to messages as described here. However, since REST requests have a total size limit of 4mb this does not allow for very large attachments.

可恢复上传会话 允许更大的上传,可以通过提供下载链接的参考附件引用.但是,这些链接显然是短暂的,我们希望在某个时候清理这些文件.

A resumable upload session allows for larger uploads that may be referenced by reference attachments providing a download link. However, these links are obviously short-lived and we would like to clean up the files at some point.

有什么方法可以创建带有大于 4mb 的持久文件附件的消息?在这里按照 DriveItem-> FileAttachment 转换的思路思考,但找不到有关该主题的任何内容.非常感谢您的帮助!

Is there any way to create a message with persistent file attachments larger than 4mb? Thinking along the lines of a DriveItem->FileAttachment conversion here, but could not find anything on the topic. Help is very much appreciated!

推荐答案

截至 2017 年 5 月 您可以使用 referenceAttachment 资源类型.这允许您将 DriveItem 从 OneDrive 附加到 message:

As of May 2017 you can use the referenceAttachment resource type. This allows you to attach a DriveItem from the OneDrive to a message:

POST https://graph.microsoft.com/beta/me/messages/AAMkAGE1M88AADUv0uFAAA=/attachments
Content-type: application/json
Content-length: 319

{ 
    "@odata.type": "#microsoft.graph.referenceAttachment", 
    "name": "Personal pictures", 
    "sourceUrl": "https://contoso.com/personal/mario_contoso_net/Documents/Pics", 
    "providerType": "oneDriveConsumer", 
    "permission": "Edit", 
    "isFolder": "True" 
} 

这篇关于大 (> 4mb) 文件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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