无法从OneDrive下载文件 [英] Not able to download a file from OneDrive

查看:470
本文介绍了无法从OneDrive下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Microsoft Graph的文档,用于下载OneDrive中文件的文件内容的API是:

According to Microsoft Graph's documentation, the API to download file contents of a file in my OneDrive is:

/beta/me/drive/items/01UG2T5D6KU5GACQUPCFE3AMTN47BTTSA6/content 

无论如何返回

Failure - Status Code 0,    
{
    "isTrusted": true
}

如果我愿意

/beta/me/drive/items/01UG2T5D6KU5GACQUPCFE3AMTN47BTTSA6

它返回正确的文件元数据-因此这意味着文件存在,因此Graph无法获取内容的任何线索

it returns the correct file metadata - so this means the file exists so any clues why Graph cannot fetch the content

推荐答案

您可以使用GET /drives/{drive-id}/items/{item-id}/content

参考: https://developer.microsoft.com/zh-CN/graph/docs/api-reference/v1.0/api/driveitem_get_content

如果您使用的是Dotnet SDK for Graph,则可以使用

If you're using Dotnet SDK for Graph, you could use

graphServiceClient.Me.Drive.Root.ItemWithPath(itemPath).Content.Request().GetAsync();

这篇关于无法从OneDrive下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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