将文档上传到 Google 文档:如何替换现有文档以及如何上传和转换大文档?
我正在尝试制作用于从 Google 帐户备份/恢复文档的工具。 备份很容易,我对此没有任何问题。但我有两个未解决的恢复问题:
1)是否可以上传现有文档的新版本?当我上传文档时,它显示为单独的副本。
我发现这里已经讨论过 使用.net api上传并替换Google文档上给定文件夹中的文件,但似乎建议在上传新版本之前删除旧版本,文档的ID将被更改。这是正确的吗?
2) Google Docs 对能够转换为内部格式的文档大小有限制。 http://docs.google.com/support/ bin/answer.py?hl=zh-CN&answer=37603。因此,可以创建大文档,将其保存到本地计算机,然后 Google 文档将拒绝转换它,因为文档的大小超出限制。在这种情况下,可以上传文档而不进行转换,但无法通过网站进行编辑。对于这种情况有一些解决方法吗?
无法将大文件上传到 Google 文档 - 以下是建议在上传之前将文档分成小块,然后将它们链接在一起。但也许还有其他想法?
I am trying to make tool for backup/restore of Documents from Google account.
Backup is easy and I have no problems with it. But I have two unsolved questions for restore:
1) Is it possible to upload new version of existing document? When I upload document, it appears as separate copy.
I found it was discussed already here Upload and replace file in given folder on Google Docs using .net api, but it seems it was suggested just to remove old version before uploading new, the Id of document will be changed. Is this correct?
2) Google Docs have limit for size of documents able to be converted into internal format. http://docs.google.com/support/bin/answer.py?hl=en&answer=37603. So it is possible to create large document, save it to local computer and then Google Docs will refuse to convert it because the document's size is over limit. In such case it is possible to upload the document without convert, but it becomes un-editable via web site. Is there some workaround for this situation?
Unable to upload large files to Google Docs - Here is advice to break document into small pieces before uploading and link them together after. But maybe there some other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.是否可以上传现有文档的新版本?当我上传文档时,它显示为单独的副本。
是的,这是可能的。正如您所注意到的,我们称之为“上传和替换”。无需先删除现有版本。以下链接介绍了如何在协议中执行此操作:
http:// /code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UpdatingMetadataAndContent
从 .NET 客户端库,您需要执行的操作是将输入流附加到 Update() 请求。您需要的方法标头位于此处:
http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/core/service.cs#554
创建一个流,其中包含你的新文件内容,然后将其传递进去。应该就是这样!
2. Google 文档有大小限制...这种情况有解决方法吗?
不幸的是,目前没有办法规避转换文档的大小限制。它们必须作为未转换的文件上传,因此在 Google 文档用户界面中不可编辑。
1. Is it possible to upload new version of existing document? When I upload document, it appears as separate copy.
Yes, this is possible. We call it "upload & replace" as you've noticed. No need to remove the existing version first. The following link describes how to do this in the protocol:
http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UpdatingMetadataAndContent
From the .NET client library, what you need to do is attach a an input stream to the Update() request. The method header for what you need is here:
http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/src/core/service.cs#554
Create a stream containing your new file content, and just pass that in. That should be it!
2. Google Docs have limit for size... Is there some workaround for this situation?
Unfortunately there is not a way currently to circumvent the size limitations of converted documents. They must be uploaded as unconverted files, and thus, are not editable in the Google Docs user interface.