Skip to content

File upload

Single part (files <8mb)

POST /v1/files/singlepart/init

Response will have id, presigned_s3_data.url and presigned_s3_data.fields.

The id will be used when submitting an analysis - it will reference the file IDs to analyze.

Assemble formdata, appending each key/value from fields. Append the file as well to the formdata.

Finally, POST the formdata to the url.

Multi part

  1. Initialize the multi-part upload

    POST /v1/files/multipart/init

    Response will have id (the BugSeq file ID) and presigned_s3_data.UploadId. The UploadId will be used to upload each chunk.

  2. Upload Each Chunk

    BugSeq recommends a 8mb chunk size.

    For each chunk:

    1. Initialize the chunk upload

      POST /v1/files/multipart/chunk. Don’t include the raw file data. The body should be JSON and contain:

      {
        "file_id": fileId,
        "upload_id": uploadId,
        "part_number": partNumber // partNumber should start at 1, not 0!
      }
      

      The response will contain a presigned address in the presigned_s3_data field.

    2. Upload the chunk data

      PUT resp.presigned_s3_data with the raw data in the body.

      Note you will need to retrieve the ETag header from the response. You should keep track of ETag and PartNumber tuples.

  3. Finally, complete the upload:

    POST /v1/files/multipart/complete

    The body should contain:

    {
      "file_id": fileId,
      "upload_id": presigned_s3_data.UploadId,
      parts: [{ "ETag": "etag1", "PartNumber": "partnumber1" }, ...]
    }