2017-01-30 50 views
3

使用Microsoft Graph API,可以按照here所述的方式向文件添加文件附件。但是,由于REST请求的总大小限制为4mb,因此不允许使用非常大的附件。Large(> 4mb)文件附件

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

有没有什么办法可以创建一个大于4mb的持久文件附件?在这里考虑DriveItem-> FileAttachment转换,但在主题上找不到任何内容。非常感谢帮助!

回答

0

May 2017开始,您可以使用referenceAttachment resource type。这使您可以将一个DriveItem从OneDrive附加到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" 
}