Skip to content

cp: support uploads larger than 100 MiB (createUploadSession) #33

Description

@lionello

upload() does a single PUT .../content, which the API caps at 100 MiB. Larger files fail with a 404 and the CLI prints "Skipped. Uploads larger than 100MiB are not yet supported."

The classic API supports resumable uploads:

POST /drive/root:/{path}:/createUploadSession
PUT  {uploadUrl}          Content-Range: bytes 0-10485759/{total}

Chunks must be a multiple of 320 KiB. The session response carries nextExpectedRanges, so an interrupted upload can be resumed rather than restarted.

Notes:

  • upload() currently gzips the whole body in memory (call() does Zlib.gzipSync) and verifies the SHA1 of the buffer afterwards. A chunked path needs to stream from disk instead, and can verify the SHA1 from the final item response.
  • @name.conflictBehavior is passed on the session-creation POST, not per chunk. See overwrite existing files #22.

README TODO: "Uploads larger than 100MiB are not yet supported (needs range API)".

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions