是否可以为特定修订设置modifiedDate?

时间:2014-10-09 18:21:57

标签: php oauth-2.0 google-drive-api google-api-php-client

我目前正在开发驱动程序sdk修订版。我可以使用" NewRevision = true"上传修订版。 ,但我无法为此设置修改日期。

$boundary = mt_rand();
$curl->setHeader("Host", "www.googleapis.com");
$curl->setHeader("Authorization", "Bearer $new_accesstoken");
$curl->setHeader("User-Agent", "CXchange-CXchange-1.0 cURL/1.11.3");
$curl->setHeader("Accept-encoding", "identity");
$curl->setHeader('Content-Type', 'multipart/related; boundary="' . $boundary . '"');
$content = '';
$content = '--' . $boundary . '
          Content-Type: application/json; charset=UTF-8

          {"modifiedDate": "' . $rev[ 'modifiedDate' ] . '"}
          --' . $boundary . '
         Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
         ' . $revison_content . '
         --' . $boundary . '--';
$curl->setHeader('content-length', strlen($content));
$rev_uploadUrl = 'https://www.googleapis.com/upload/drive/v2/files/' . $newFileId . '?uploadType=multipart&newRevision=true&convert=true';
$curl->put($rev_uploadUrl, $content);

它会返回成功的消息,但是当我转到Google云端硬盘用户界面并尝试在右侧窗格中查看修改列表时,修改后的时间未按照我的指示进行更新

请帮助我克服这个

1 个答案:

答案 0 :(得分:0)

在查询字符串中传递setModifiedDate=true

来源:https://developers.google.com/drive/v2/reference/files/update