Microsoft Graph:在OneDrive上将文件上传到与我共享文件夹吗? [英] Microsoft Graph: Uploading files to shared with me folder on OneDrive?
问题描述
I was able to successfully upload to Shared Documents folder using this approach. But I am looking for a way to upload files to Shared WithMe folder on OneDrive.
是否可以上传到OneDrive上的"/Shared WithMe"文件夹?如果是这样,那么PUT(小文件)或POST(上传会话)的正确语法是什么?我花了很多时间来解决这个问题,但是没有运气.
Is it possible to upload to "/Shared WithMe" folder on OneDrive? If so, which is the right syntax for the PUT (small file) or POST (upload session)? I spent a lot of time to figure this out but no luck.
任何帮助将不胜感激.
推荐答案
我成功地采用了这种方法:
I had success with this approach:
PUT /drives/{driveid}/items/{itemid}/content
我能够从DriveItem
实体中检索driveid
和itemid
.对于给定的DriveItem
,driveid
位于DriveItem.RemoteItem.ParentReference.DriveId
( RemoteItem文档).
I was able to retrieve the driveid
and the itemid
from the DriveItem
entity. For a given DriveItem
, the driveid
is at DriveItem.RemoteItem.ParentReference.DriveId
(ItemReference docs) and the itemid
is at DriveItem.RemoteItem.Id
(RemoteItem docs).
Files.ReadWrite.All权限似乎是必需的.
The Files.ReadWrite.All permission seems to be required.
这种方法在UWP C#Graph SDK中对我有用.
This approach worked for me in the UWP C# Graph SDK.
这篇关于Microsoft Graph:在OneDrive上将文件上传到与我共享文件夹吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!