Uploads

Prepare Upload

Prepare an upload batch for data transfer

Request

  • metadata
    optional empty object
  • files
    array of objects
    • files.multipart
      boolean
    • files.path
      string
    • files.mime
      nullable string
    • files.contentLength
      string

Response

  • upload
    object
    • upload.files
      array of objects
      • upload.files.presignedChunks
        array of objects
        • upload.files.presignedChunks.url
          string
        • upload.files.presignedChunks.partNumber
          number
        • upload.files.presignedChunks.contentLength
          string
        • upload.files.presignedChunks.offset
          string
      • upload.files.path
        string
      • upload.files.mime
        nullable string
      • upload.files.contentLength
        string
    • upload.id
      string
    • upload.metadata
      optional empty object
    • upload.bucket
      string
    • upload.contentLength
      string
    • upload.createdAt
      string
    • upload.updatedAt
      string
    • upload.completedAt
      nullable string

Usage

1. Install the module

2. Use this script

const data = await ctx.modules.uploads.prepare({
  // Request body
});