首页 > 解决方案 > MS Graph API:DriveItem 信息中的文件大小错误

问题描述

我有一个带有敏感度标签集的 Word 文件。使用以下方式获取此文件信息时:

GET /drives/{drive-id}/items/{item-id}

我得到以下回复:

  "@odata.context": *",
  "@microsoft.graph.downloadUrl": "*",
  "createdDateTime": "2020-11-23T14:34:46Z",
  "eTag": "\"{57B2B6AB-CA5B-4404-B714-69D4ACF1BAD2},10\"",
  "id": "*",
  "lastModifiedDateTime": "2020-11-23T14:35:42Z",
  "name": "Document.docx",
  "webUrl": "*",
  "cTag": "*",
  "size": 36298,
  "createdBy": *,
  "lastModifiedBy": *
  },
  "parentReference": *,
  "file": {
    "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    "hashes": {
      "quickXorHash": "KxC7GCjPid2b5o3NGboS9vBPhKg="
    }
  },
  "fileSystemInfo": {
    "createdDateTime": "2020-11-23T14:34:46Z",
    "lastModifiedDateTime": "2020-11-23T14:35:42Z"
  }

如您所见,文件的大小为36298。但是,如果我使用来自@microsoft.graph.downloadUrl的链接下载文件,我可以看到文件大小更大。查看响应中的 content-length 标头,文件大小为59392。我只在设置了敏感度标签的文件中看到这种行为。这是预期会发生的事情还是MS Graph中的错误?

标签: sharepointmicrosoft-graph-apionedrive

解决方案


推荐阅读