javascript - html 中的 Microsoft onedrive
问题描述
我在这里有这段代码来读取 onedrive 上的文件:
PATCH /me/drive/items/{item-id}
Content-type: application/json
{
"name": "new-file-name.docx"
}
并更新文件:
PUT /me/drive/items/{item-id}/content
Content-Type: text/plain
The contents of the file goes here.
但是我在哪里登录我的微软帐户?
解决方案
当您使用 JavaScript 时,您需要创建将执行这些操作的应用程序。有一个 SDK 可用于访问 Microsoft Graph,并且您可以将 MSAL 库用于 JavaScript,从而更容易执行身份验证。
完整的过程有点太长,无法在一个回复中描述。出于这个原因,我强烈建议您遵循 Microsoft Learn 上的本教程:https ://docs.microsoft.com/en-us/learn/modules/msgraph-manage-files/
推荐阅读
- sql - SQL - 会员一年只能看一次医生
- javascript - 在 1 页 Django 中从数据库 1 中检索数据
- gravityforms - Gravity Forms 如何在页面渲染时设置简单文本字段的值
- ios - 如何将 WebRTC 与 ios app swift 集成?
- sql-server - SetSPN for Always-On 启用的服务器
- angular - 尝试在 Edge 中打开 PDF 文件显示“某些东西使此 PDF 文件无法打开”错误
- html - 选择标签在释放点击时关闭 - Angular
- python-3.x - python windows中的PyAudio安装错误
- powershell - 使用 PowerShell 的 Get-ChildItem,我如何列出匹配的文件并同时计算它们
- react-native - react-navigation:如何使BottomTab的按钮不显示?