Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive uploading file size limit

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.

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

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

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: Im using this uploader as is, only with cosmetic changes.

like image 322
Vlad Tsepelev Avatar asked Nov 04 '13 13:11

Vlad Tsepelev


People also ask

What is the largest file size I can upload to Google Drive?

Individual users can only upload 750 GB each day between My Drive and all shared drives. Users who reach the 750-GB limit or upload a file larger than 750 GB cannot upload additional files that day. Uploads that are in progress will complete.

Can I upload 5 GB file in Google Drive?

You can also drag and drop a file into the Google Drive window to begin uploading it immediately. Google Drive supports files up to 5 TB in size (provided you actually have that much storage available).

How many MB can you upload to Google Drive?

​Up to 1.02 million characters. If you convert a text document to Google Docs format, it can be up to 50 MB.


1 Answers

OK. I got it.

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).

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').

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').

Conclusion:

  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:

{"error":{"errors":[{"domain":"global","reason":"backendError","message":"Backend Error"}],"code": 500,"message": "Backend Error"}}

like image 81
Vlad Tsepelev Avatar answered Oct 06 '22 00:10

Vlad Tsepelev