Skip to content

SourceMap Multipart Upload Related API Usage Guide

Multipart Upload Workflow

  1. Initialize a Multipart Upload Event: Specify the application, environment, and version to obtain the upload task ID uploadId.
  2. Upload a Single Part: Split the SourceMap archive into parts and upload each part using the same uploadId and the chunkIndex of each part. Keep each part within 10 MB.
  3. List Uploaded Parts: Read the chunkIndexs of the task and re-upload any missing parts within the task validity period.
  4. Merge Parts to Generate the File: Call this after confirming all parts are uploaded. The server merges the archive by part sequence and submits an asynchronous decompression task.

A successful merge response indicates that the file has been merged and the decompression task has been submitted. It does not mean decompression is complete or that the SourceMap is already available for parsing.

Initialization Result and Validity

  • The uploadId is valid for 3600 seconds by default. All subsequent uploads, part listing, and merging must use the same valid task ID.
  • If initialization returns existsSameFile=true and needCover=true is not set, an empty uploadId may be returned. Confirm whether you need to overwrite the file for the same application, environment, and version before deciding whether to reinitialize.
  • On receiving ft.InvalidUploadId, reinitialize the task and re-upload the required parts; do not continue reusing the invalid ID.

Canceling an Upload

Use Cancel a Multipart Upload Event to cancel the entire valid task associated with the uploadId, deleting the task cache and the part directory of the task. This API cannot be used to delete only a single part.

When the task has already expired, the cancel API does not guarantee cleanup of the old part directory; re-uploading requires a newly initialized uploadId.

Single-File Content Upload

Upload Single File Content is used to directly upload the content of a single source file after SourceMap decompression. Pass the application, environment, version, file name, and content as required by the API; there is no need to go through the multipart initialization and merge workflow. The 10 MB limit mentioned above applies to the multipart upload API.