无法将大文件上传到 Google 文档

发布于 2024-09-01 07:08:14 字数 742 浏览 2 评论 0原文

我正在 Google Docs 上上传文档:

DocumentsService myService = new DocumentsService("");
myService.setUserCredentials("[email protected]", password );
DocumentEntry newEntry = myService.UploadDocument(@"C:\Sample.txt", "Sample.txt");

但是当我尝试上传 3 MB 的文件时,出现异常:

未处理的类型异常 'Google.GData.Client.GDataRequestException' 发生在Google.GData.Client.dll中 附加信息:执行 请求失败: http://docs.google.com/feeds/documents/private/full

如何将大文件上传到 Google 文档? 我正在使用 Google API 版本 2。

I am uploading documents on Google Docs as:

DocumentsService myService = new DocumentsService("");
myService.setUserCredentials("[email protected]", password );
DocumentEntry newEntry = myService.UploadDocument(@"C:\Sample.txt", "Sample.txt");

But when I try to upload a file of 3 MB I get an exception:

An unhandled exception of type
'Google.GData.Client.GDataRequestException'
occurred in Google.GData.Client.dll
Additional information: Execution of
request failed:
http://docs.google.com/feeds/documents/private/full

How can I upload large files to Google Docs?
I am using Google API ver 2.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

汹涌人海 2024-09-08 07:08:14

在您的代码中,您尝试上传 .txt 文件。

这将被转换为 Google Docs“文档”文件。

可以转换的文件限制为 100 万个字符(大小为 2Mb)。

如果您将扩展名类型更改为 Google Docs 无法识别的内容(例如 .log),它将允许您上传最大 10Gb 的文件!虽然免费帐户只有 1Gb 的文件存储空间。

这将允许您通过应用程序存储和检索文件,但用户将无法使用 Google 文档界面直接修改它们,尽管他们仍然可以下载它们。

In your code you are attempting to upload a .txt file.

This will be converted to a Google Docs "Document" file.

Files that can be converted are limited to 1 Million characters of (2Mb in size).

If you change the extension type to something that is not recognised by Google Docs (for example .log), it will allow you to upload a file of up to 10Gb! Although the free account only has 1Gb of storage for files.

This will allow you to store and retrieve files via your application, but the user will not be able to directly modify them with the Google docs interface, although they can still download it.

长途伴 2024-09-08 07:08:14

上传的文件大小有限制:
http://docs.google.com/support/ bin/answer.py?hl=zh-CN&answer=37603
请注意,已完成对 html 的转换,并且转换后的大小已达到限制。

如果您可以发布更多细节,我可能会想出一个创造性的解决方案。到目前为止我想到的是:
如何将文档分成更小的文档,然后在文档中的文件名或实际链接中进行链接。
将文档预处理为精简文本(不确定您需要上传哪种文件。
作为存储的文件上传,也许有一个谷歌文档,可以将内容加载到 iframe 或类似的东西中。
但是,是的,如果你愿意的话,如果你给我更多细节,我可以考虑一下。

There is a limit on size of file being uploaded:
http://docs.google.com/support/bin/answer.py?hl=en&answer=37603
Note that there is a conversion done to html and that post-conversion size id the limit.

If you could post some more specifics I could probably come up with a creative solution. What comes to mind so far are:
How about break document up into smaller documents and link then in either file name or actual link in document.
Pre process the document into streamlined text (not sure what kind of files you need to upload.
Upload as stored files and maybe have a google doc that loads the content in an iframe or something similar.
But yeah, if you give me more details, I can think it out if you like.

橘和柠 2024-09-08 07:08:14

尝试查找条款和条件,如果它们支持更大的文件。库中还会设置超时,看看是否可以增加 GData.Client 中的超时值

Try to findout terms and conditions, if they support larger files. Also there will be timeouts set in the library, see ifyou can increase your timeout values in your GData.Client

云淡风轻 2024-09-08 07:08:14

要转换的文档的文件限制为 500Kb。

http://docs.google.com/support/ bin/answer.py?hl=zh-CN&answer=37603

You have a file limit of 500Kb for documents to be converted.

http://docs.google.com/support/bin/answer.py?hl=en&answer=37603

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文