简体   繁体   English

Microsoft Graph:将文件从URL [C#]上传到onedrive

[英]Microsoft Graph: upload files to onedrive from URL [C#]

is it possible to upload files to Onedrive (with Microsoft Graph) from an URL? 是否可以从URL将文件上传到Onedrive(使用Microsoft Graph)? If so, please can you give me a code snippet or tell me, how to create the request? 如果是这样,请您给我一个代码段或告诉我如何创建请求?

Or have i to download the files first and then upload it from local drive to Onedrive? 还是让我先下载文件,然后将其从本地驱动器上传到Onedrive?

Thanks in advance! 提前致谢!

Max 最高

The Microsoft Graph API does not currently support uploading from a URL. Microsoft Graph API当前不支持从URL上传。 You have to download the file locally first, and then upload it. 您必须先在本地下载文件,然后再上传。

If you are targeting OneDrive Personal (not Business), then you can still use the OneDrive REST API to upload from URL: https://dev.onedrive.com/items/upload_url.htm 如果您以OneDrive个人版(而非企业版)为目标,则仍可以使用OneDrive REST API从URL上传: https : //dev.onedrive.com/items/upload_url.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM