Uploading in parts
1
Start the upload
POST /uploads with the file’s filename (with its extension) and its size in bytes. The answer gives the part_size, the part_count, and signed links for the first parts.2
PUT each part
Send bytes
(n - 1) × part_size up to n × part_size of the file to part n’s link, and keep the ETag header of each answer. Parts can go in any order and in parallel.3
Ask for more links when you need them
The first answer has links for up to 100 parts, and each link lasts 15 minutes.
POST /uploads/{id}/parts with {"part_numbers": [101, 102, …]} signs up to 100 more at a time. Ask again for any link that expired.4
Complete the upload
POST /uploads/{id}/complete with every part number and its ETag. The upload becomes uploaded.part_size we send rather than choosing your own.
Uploading from a link
If the file is already online, send its address instead of a filename and size:202 with the upload in fetching. We download the file and the upload becomes uploaded, or failed with an error saying why. Check it with GET /uploads/{id} every 10 to 30 seconds, then start the dubs as usual.
- The link must be
httporhttpson the standard ports and reachable from the internet. Links to private networks are refused. - If the link doesn’t end in a file name, add
filenamewith the right extension. - Each account can have 3 links downloading at once. Past that you get
429 TOO_MANY_FETCHES. - A download that is very slow or stalls fails with
SOURCE_URL_TOO_SLOW. Host the file somewhere faster, or upload it in parts.
Upload statuses
Uploads that are never completed expire. If completing one gives
UPLOAD_GONE, start a new upload.