Chunked & Multipart Uploads

For large files up to 10 GB on Business (video reels, database archives, RAW photo batches), Elept provides an S3-compatible chunked multipart upload workflow. This allows uploading files in resilient 5MB parts with automatic retry safety (standard single-request POST uploads via /api/v1/files are capped at 128 MB by server limits).

Multipart Workflow Overview

  1. Initiate Multipart Upload: Call POST /api/v1/uploads/multipart/initiate with file metadata to acquire an upload_id and object_key.
  2. Sign Parts: For each 5MB chunk (part 1 to N), request a presigned PUT URL via POST /api/v1/uploads/multipart/sign-part.
  3. Direct PUT: Send the binary chunk directly to the presigned storage URL using HTTP PUT. Record the returned ETag header.
  4. Complete Multipart: Call POST /api/v1/uploads/multipart/complete with all part numbers and ETags to assemble the file.

1. Initiate Multipart Upload

POST /api/v1/uploads/multipart/initiate
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
    "filename": "backup-2026-10-21.tar.gz",
    "mime_type": "application/gzip",
    "visibility": "private",
    "size": 1048576000
}

Response (HTTP 200 OK):

{
    "success": true,
    "upload_id": "mp_9a8b7c6d5e...",
    "file_uid": "file_8f1a2b3c4d5e",
    "object_key": "f/file_8f1a2b3c4d5e.tar.gz",
    "part_size": 5242880,
    "sign_part_url": "/api/v1/uploads/multipart/sign-part",
    "complete_url": "/api/v1/uploads/multipart/complete",
    "abort_url": "/api/v1/uploads/multipart/abort"
}

2. Sign & Upload Each Part

POST /api/v1/uploads/multipart/sign-part
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
    "object_key": "f/file_8f1a2b3c4d5e.tar.gz",
    "upload_id": "mp_9a8b7c6d5e...",
    "part_number": 1
}

Response gives an authentic signed URL to PUT binary chunk data directly to the storage provider:

{
    "success": true,
    "part_number": 1,
    "upload_id": "mp_9a8b7c6d5e...",
    "signed_url": "https://pub2.filecdnx.com/f/file_8f1a2b3c4d5e.tar.gz?partNumber=1&uploadId=mp_...",
    "method": "PUT"
}

3. Complete Multipart Upload

POST /api/v1/uploads/multipart/complete
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
    "object_key": "f/file_8f1a2b3c4d5e.tar.gz",
    "upload_id": "mp_9a8b7c6d5e...",
    "file_uid": "file_8f1a2b3c4d5e",
    "filename": "backup-2026-10-21.tar.gz",
    "size": 1048576000,
    "parts": [
        { "part_number": 1, "etag": "\"d41d8cd98f00b204e9800998ecf8427e\"" },
        { "part_number": 2, "etag": "\"a1b2c3d4e5f60718293a4b5c6d7e8f90\"" }
    ]
}

Response (HTTP 201 Created):

{
    "success": true,
    "file": {
        "id": 1042,
        "file_uid": "file_8f1a2b3c4d5e",
        "name": "backup-2026-10-21.tar.gz",
        "size": 1048576000,
        "size_formatted": "1000.00 MB",
        "mime_type": "application/gzip",
        "is_public": false,
        "public_url": null,
        "download_url": "/f/file_8f1a2b3c4d5e",
        "room_id": null,
        "created_at": "2026-10-23 11:00:00"
    }
}

4. Aborting Failed Uploads

If a transfer is cancelled or fails, call POST /api/v1/uploads/multipart/abort with upload_id and object_key to immediately remove all stored parts and free allocated storage.

POST /api/v1/uploads/multipart/abort
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
    "object_key": "f/file_8f1a2b3c4d5e.tar.gz",
    "upload_id": "mp_9a8b7c6d5e..."
}

Response (HTTP 200 OK):

{
    "success": true
}
Standard Upload Next: Error Codes