SourceMap Multipart Upload Related API Usage Guide¶
Multipart Upload Workflow¶
- Initialize a Multipart Upload Event: Specify the application, environment, and version to obtain the upload task ID
uploadId. - Upload a Single Part: Split the SourceMap archive into parts and upload each part using the same
uploadIdand thechunkIndexof each part. Keep each part within 10 MB. - List Uploaded Parts: Read the
chunkIndexsof the task and re-upload any missing parts within the task validity period. - 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
uploadIdis valid for 3600 seconds by default. All subsequent uploads, part listing, and merging must use the same valid task ID. - If initialization returns
existsSameFile=trueandneedCover=trueis not set, an emptyuploadIdmay 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.