@musallam/storage-and-collaboration-client
    Preparing search index...
    • Initializes a block based replacement job for an existing file. The init response provides a set of pre-signed URLs for uploading individual blocks, transferred over separate requests. Once the replacement file content is uploaded, the finalize endpoint is called to finalize the replacement.

      The file's assetId, permissions, and metadata are preserved while the content is replaced.


      NOTE: For files 10 MB or larger, direct replacement is not supported. Clients must use this block-based replacement workflow. block-based transfer is allowed for any size


      Client sends a POST request to initiate the block replacement and receives a response with URLs for uploading individual blocks and finalizing the transfer.

      Client issues PUT requests to the provided Block Transfer URLs, sending file data in chunks. These can be uploaded in parallel.


      NOTE: ####Uploading File Blocks After receiving transferLinks, clients can use them to upload individual blocks: PUT

      • Authorization Header: Must NOT be included in the request.
      • Success Response: 200 OK indicates successful block upload.
      • Expiration Handling: Each upload session is time-bound. If blocks are not uploaded within the specified expiration window (urlExpirationDate field from the initiation response), the operation may fail.
        • Always check and respect the urlExpirationDate timestamp in the response from the Block Upload Init endpoint.

      After all blocks are uploaded, the client calls the Block Finalize URL to trigger the replacement.

      Finalize operation's response includes a Monitor URL to check the final status.

      Initialize the Block-Based Replacement

      This endpoint allows clients to initiate the replacement of an existing file's content using block-based transfer.


      NOTE:

      • The expiration duration of transfer URLs is explicitly provided to the client in the response
      • The Content-Type must match the existing file's media type. Attempting to change the content type will result in a 415 Unsupported Media Type error.

      Parameters

      Returns Promise<FileUploadInitResponseResponse>