本文介绍了谷歌驱动器上传文件大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着通过REST API(可恢复上传)上传我的文件到谷歌驱动器。
一切看起来不错( XMLHtt prequest 触发器 onprogress 的onload 事件),但之后(onload事件触发)谷歌驱动PUT请求失败,并 500内部服务器错误。文件没有出现在我的谷歌云端硬盘文件夹。错误500进来 xhr.onload ,而不是 xhr.onerror

Im trying to upload my files to Google Drive via REST API (resumable upload).Everything looks good (XMLHttpRequest triggers onprogress and onload events), but after it (onload triggered) Google Drive PUT request fail with 500 Internal Server Error. File not appears in my Google Drive folder. Error 500 comes in xhr.onload, not in xhr.onerror.

如果我尝试上传通过谷歌驱动器接口该文件同样的事情。它有时会发生,我也没有环境100%再现。

Same thing if im trying to upload that file via Google Drive interface. It happens sometimes, and i haven't environment with 100% reproducing.

文件类型的Adobe .DNG 佳能.CR2 和文件大小的〜28MB

Filetype Adobe .DNG or Canon .CR2 and filesize ~28MB.

什么即时通讯做错了什么?这是已知的bug或限制文件类型或文件?

What im doing wrong? Is it known bug or limitations to filetypes or file?

可能的原因:文件大小限制,文件类型限制,或者而我的文件上传我的令牌过期?

Possible reasons: filesize limitations, filetype limitations, or maybe my token is expires while my file is uploading?

UPD:即时通讯使用原样,只能用化妆品的变化。

UPD: Im using this uploader as is, only with cosmetic changes.

推荐答案

确定。我知道了。

文件与内容类型==应用程序/八位字节流成功上传。看起来像Google云端硬盘一侧的错误使用MIME-type'd文件。
在这种情况下我的RAW文件(DNG,CR2,NEF等)存储在Google云端硬盘不正确的MIME类型(其结果有这些文件没有preVIEW)。

Files uploads successfully with Content-Type == "application/octet-stream". Looks like bug on GoogleDrive side with mime-type'd files.In this scenario my raw files (DNG, CR2, NEF etc.) stores in GoogleDrive with incorrect mime-type (as a result there is no preview for these files).

所以我无法通过筛选文件的MIME类型了。

So i can't filter files by mime-type anymore.

Query string = (mimeType = 'image/x-adobe-dng' or mimeType = 'image/x-canon-cr2' or mimeType = 'image/x-nikon-nef').

我试图筛选按关键字标题的文件,不过貌似标题不包含扩展,但响应项目标题包含扩展。

I tried to filter files by keyword title, but looks like titles doesn't contain extension, but in response item titles contain extension.

Query string = (title contains '.dng' or title contains '.cr2' or title contains '.nef').

所以我必须用MIME类型或标题不过滤我的文件,但全文关键字。

So i have to filter my files not by mime-type or by title, but by fullText keyword.

Query string = (fullText contains '.dng' or fullText contains '.cr2' or fullText contains '.nef').

结论:


  1. Google云端硬盘上传检查内容类型,即使转换选项设置为

  2. Google云端硬盘时有没有时间与本 convertation

  3. 上传正常工作与内容类型=='应用程序/八位字节流

  4. Google云端硬盘查询字符串关键字的标题不包含文件扩展名,但响应的标题有扩展名。

  5. Google云端硬盘查询字符串关键字的全文包含扩展文件名(MB它不是非常快的文本文件)。

  6. 要测试你的要求,你可以使用此工具在页面的结尾。

  7. Google云端硬盘API崩溃不时与HTTP状态 500内部服务器错误

  1. GoogleDrive uploader checks Content-Type, even if convert option is set to false.
  2. GoogleDrive fails from time to time with this convertation.
  3. Uploader works fine with Content-Type == 'application/octet-stream'.
  4. GoogleDrive query string keyword title doesn't contain file extension, but in response titles have extension.
  5. GoogleDrive query string keyword fullText contains filename with extension (mb its not very fast for text files).
  6. To test your request you can use this tool https://developers.google.com/drive/v2/reference/files/list in the end of page.
  7. GoogleDrive API crashes from time to time with HTTP status 500 Internal Server Error:

{错误:{错误:[{域:全局,理:backendError,消息:后端错误}],code:500,消息:后端错误}}

这篇关于谷歌驱动器上传文件大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 05:57