【发布时间】:2012-06-06 14:28:11
【问题描述】:
背景
我目前正在使用 Google Drive/Docs 实现一个应用程序。我正在使用最新的 .NET library for Google Data APIs 库上传图片,并利用 Google Drive 作为图片库。
问题
我希望能够设置与 Google 云端硬盘中的每个项目关联的描述字段。上传工作正常,我无法让描述字段工作。
我可以看到 post 中提到的修改已集成到最新的库中,因此 DocumentEntry 类现在有一个 Description 成员。
将此新成员设置为文本时,在将文件插入 Google 云端硬盘时会引发 (400) Bad Request 错误。完整的错误是:
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>ParseException</code>
<internalReason>[Line 3, Column 42, element docs:description] Unknown attribute: 'value' </internalReason>
</error>
<error>
<domain>GData</domain>
<code>ParseException</code>
<internalReason>Unknown attribute: 'value' </internalReason>
</error>
</errors>
我尝试过使用.Summary 和.Content.Content,但没有结果。代码作为我想要实现的示例:
DocumentEntry entry = new DocumentEntry();
entry.Title.Text = "Test Upload";
entry.Description = "Tag1, Tag2"; // Once I set this I get the error
entry.Summary.Text = "Tag3, Tag 4"; // This doesn't do anything!
问题
任何有关人们这样做或之前研究过的经验的帮助将不胜感激。
有人成功实现了这个功能吗?或者,是客户端无法控制的 Google API 的限制?
【问题讨论】:
标签: .net google-docs-api google-data-api