Microsoft Graph: Uploading files to shared with me folder on OneDrive?

不打扰是莪最后的温柔 提交于 2020-01-16 11:11:20

问题


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.

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.

Any help would be greatly appreciated.


回答1:


I had success with this approach:

PUT /drives/{driveid}/items/{itemid}/content

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).

The Files.ReadWrite.All permission seems to be required.

This approach worked for me in the UWP C# Graph SDK.



来源:https://stackoverflow.com/questions/48142134/microsoft-graph-uploading-files-to-shared-with-me-folder-on-onedrive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!