1

我们正在使用 Google Drive API 将数据上传到 Google 团队驱动器。 https://developers.google.com/apis-explorer/#p/drive/v3

需要就以下问题提出建议。

  1. 我们想修改上传到自定义日期(过去日期)的文档的 CreatedTime 字段。当我们尝试更新它时,我们收到错误

“资源主体包含不可直接写入的字段”

您能否告知是否有任何方法可以将 CreateTime 更新为自定义日期(而不是上传文档的日期)

  1. 同样,我们还想更新 CreatedBy 属性,我们看到 Google Drive 文档具有 owner 属性,该属性保存已上传文档的用户的值。当我们从自定义代码上传时,我们想将其设置为自定义值。您能否告知这是否可能,因为我们遇到了错误"The resource body includes fields which are not directly writable "
4

1 回答 1

1

Not all the files are updatable with the API. Logically speaking a create date is just that the date a file is created changing that would result in invalid data as it would not be true the date it was created was the date it was created.

There is really no way you are going to be able to fix this unless you want to create a file in an hour in which case i sugest you create a new file then and copy the data to that date. This will of course not work if you want to create a file in the past

于 2018-10-29T10:47:20.323 回答