Page Summary
-
The Google API Client Library for Java supports direct and resumable media uploads.
-
Resumable media upload is used for large files, sending them in chunks and reducing failure chances compared to direct upload.
-
The main classes for media upload are MediaHttpUploader and MediaHttpProgressListener.
-
Direct media upload sends the entire file in a single request and is enabled by setting
mediaHttpUploader.setDirectUploadEnabled(true).
This document describes how to use direct and resumable media uploads with the Google API Client Library for Java.
Resumable media upload
When you upload a large media file to a server, use resumable media upload to send the file chunk by chunk. The Google API generated libraries contain convenience methods for interacting with resumable media upload.
The resumable media upload protocol is similar to the resumable media upload protocol described in the Google Drive API documentation.
Protocol design
The following sequence diagram shows how the resumable media upload protocol works: