Sample code for 30+ languages & platforms
DataFlex Requires Chilkat v11.6.0+

S3 Http: List Incomplete Multipart Uploads

See more S3 - HTTP Examples

Uses Chilkat.Http with Amazon S3 general purpose buckets and Signature Version 4. These examples do not cover directory buckets/S3 Express, access-point ARNs, Outposts, or other specialized endpoints. They target the commercial AWS partition; other partitions need their documented endpoint suffix.

Load private qa_data/aws/s3.json containing nonempty string fields access_key and secret_key, plus session_token for temporary credentials. Prefer short-lived role credentials. These samples do not discover AWS profiles or refresh credentials. Set the bucket's actual region and replace sample bucket names and object keys. TLS certificate verification is explicitly enabled. Keep detailed HTTP diagnostics private because they can contain credentials or presigned URLs.

Uses explicit signed Http requests to preserve query parameters, conditional headers, and full responses. The included SigV4 block signs the exact path, sorted encoded query and headers used by this example; it is not a general-purpose HTTP signing library. Keep the clock accurate and do not change signed data after signing. Code requires Chilkat 11.6.0 or later; locally tested with 11.8.0.

Lists active multipart uploads with max-uploads=1000 and both pagination markers. Decodes encoded key markers once, while upload IDs remain opaque. Requires s3:ListBucketMultipartUploads. Useful after an uncertain initiation response or to find stale uploads. Listing does not abort anything; inspect the key, upload ID and application state before cleanup.

AWS reference

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Handle hoStringCompare
    Handle hoCredentials
    Boolean iStringMatch1
    Boolean iStringMatch2
    Handle hoHttp
    Boolean iStringMatch3
    String sRegion
    Handle hoEndpoint
    String sBucketName
    Variant vResponse
    Handle hoResponse
    Handle hoSigner
    Handle hoNow
    Handle hoTimestamp
    Handle hoCanonical
    Handle hoCanonicalHeaders
    Handle hoSignedHeaders
    Handle hoScope
    Handle hoStringToSign
    Handle hoSigningKey
    Handle hoAuthorization
    Handle hoUrl
    Handle hoQuery
    Handle hoNumber
    Handle hoHost
    Handle hoUri
    Handle hoXml
    String sAmzDate
    String sDateStamp
    String sPayloadHash
    String sCanonicalHash
    String sDerivedKey
    String sSignature
    Integer iReplaceCount
    Handle hoSeen
    Boolean iMore
    Integer iPage
    String sMarker
    String sTruncated
    String sItem
    String sKeyMarker
    String sUploadMarker
    Handle hoCursor
    Boolean iStringMatch4
    Boolean iStringMatch5
    Boolean iStringMatch6
    Boolean iStringMatch7
    Integer i
    Boolean iStringMatch8
    Boolean iStringMatch9
    Boolean iStringMatch10
    Boolean iStringMatch11
    Boolean iStringMatch12
    Boolean iStringMatch13
    Boolean iStringMatch14
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    Move False To iSuccess

    Get Create (RefClass(cComChilkatStringBuilder)) To hoStringCompare
    If (Not(IsComObjectCreated(hoStringCompare))) Begin
        Send CreateComObject of hoStringCompare
    End
    //  This example requires the Chilkat API to have been previously unlocked.
    //  See Global Unlock Sample for sample code.
    //  Load private credentials; never put access keys or session tokens in source.
    Get Create (RefClass(cComChilkatJsonObject)) To hoCredentials
    If (Not(IsComObjectCreated(hoCredentials))) Begin
        Send CreateComObject of hoCredentials
    End
    Set ComStrict Of hoCredentials To True
    Get ComLoadFile Of hoCredentials "qa_data/aws/s3.json" To iSuccess
    If (iSuccess <> True) Begin
        Showln "Could not load private S3 credentials."
        Procedure_Return
    End

    Get ComStringOf Of hoCredentials "access_key" To sTemp1
    Get ComSetString Of hoStringCompare sTemp1 To iSuccess
    Get ComContentsEqual Of hoStringCompare "" True To iStringMatch1
    Get ComJsonTypeOf Of hoCredentials "access_key" To iTemp1
    If ((iTemp1 <> 1) Or (iStringMatch1 = True)) Begin
        Showln "Missing or invalid access_key."
        Procedure_Return
    End

    Get ComStringOf Of hoCredentials "secret_key" To sTemp1
    Get ComSetString Of hoStringCompare sTemp1 To iSuccess
    Get ComContentsEqual Of hoStringCompare "" True To iStringMatch2
    Get ComJsonTypeOf Of hoCredentials "secret_key" To iTemp1
    If ((iTemp1 <> 1) Or (iStringMatch2 = True)) Begin
        Showln "Missing or invalid secret_key."
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End
    Get ComStringOf Of hoCredentials "access_key" To sTemp1
    Set ComAwsAccessKey Of hoHttp To sTemp1
    Get ComStringOf Of hoCredentials "secret_key" To sTemp1
    Set ComAwsSecretKey Of hoHttp To sTemp1
    Get ComHasMember Of hoCredentials "session_token" To bTemp1
    If (bTemp1 = True) Begin
        Get ComStringOf Of hoCredentials "session_token" To sTemp1
        Get ComSetString Of hoStringCompare sTemp1 To iSuccess
        Get ComContentsEqual Of hoStringCompare "" True To iStringMatch3
        Get ComJsonTypeOf Of hoCredentials "session_token" To iTemp1
        If ((iTemp1 <> 1) Or (iStringMatch3 = True)) Begin
            Showln "session_token must be a nonempty string when supplied."
            Procedure_Return
        End

        Get ComStringOf Of hoCredentials "session_token" To sTemp1
        Set ComAwsSessionToken Of hoHttp To sTemp1
    End

    //  Current Chilkat uses SigV4 by default. Do not select deprecated SigV2.
    //  Set the actual bucket region, not the caller's location.
    Move "us-west-2" To sRegion
    Set ComAwsRegion Of hoHttp To sRegion
    Get Create (RefClass(cComChilkatStringBuilder)) To hoEndpoint
    If (Not(IsComObjectCreated(hoEndpoint))) Begin
        Send CreateComObject of hoEndpoint
    End
    Get ComAppend Of hoEndpoint "s3." To iSuccess
    Get ComAppend Of hoEndpoint sRegion To iSuccess
    Get ComAppend Of hoEndpoint ".amazonaws.com" To iSuccess
    Get ComGetAsString Of hoEndpoint To sTemp1
    Set ComAwsEndpoint Of hoHttp To sTemp1
    Set ComRequireSslCertVerify Of hoHttp To True
    Set ComFollowRedirects Of hoHttp To False
    //  A region redirect is not success. Correct the endpoint and signing region.
    Move "your-bucket-name" To sBucketName
    Get Create (RefClass(cComChilkatHttpResponse)) To hoResponse
    If (Not(IsComObjectCreated(hoResponse))) Begin
        Send CreateComObject of hoResponse
    End
    Get Create (RefClass(cComChilkatCrypt2)) To hoSigner
    If (Not(IsComObjectCreated(hoSigner))) Begin
        Send CreateComObject of hoSigner
    End
    Set ComCharset Of hoSigner To "utf-8"
    Set ComHashAlgorithm Of hoSigner To "sha256"
    Set ComEncodingMode Of hoSigner To "hexlower"
    Set ComMacAlgorithm Of hoSigner To "hmac"
    Get Create (RefClass(cComCkDateTime)) To hoNow
    If (Not(IsComObjectCreated(hoNow))) Begin
        Send CreateComObject of hoNow
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoTimestamp
    If (Not(IsComObjectCreated(hoTimestamp))) Begin
        Send CreateComObject of hoTimestamp
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoCanonical
    If (Not(IsComObjectCreated(hoCanonical))) Begin
        Send CreateComObject of hoCanonical
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoCanonicalHeaders
    If (Not(IsComObjectCreated(hoCanonicalHeaders))) Begin
        Send CreateComObject of hoCanonicalHeaders
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoSignedHeaders
    If (Not(IsComObjectCreated(hoSignedHeaders))) Begin
        Send CreateComObject of hoSignedHeaders
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoScope
    If (Not(IsComObjectCreated(hoScope))) Begin
        Send CreateComObject of hoScope
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoStringToSign
    If (Not(IsComObjectCreated(hoStringToSign))) Begin
        Send CreateComObject of hoStringToSign
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoSigningKey
    If (Not(IsComObjectCreated(hoSigningKey))) Begin
        Send CreateComObject of hoSigningKey
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoAuthorization
    If (Not(IsComObjectCreated(hoAuthorization))) Begin
        Send CreateComObject of hoAuthorization
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoUrl
    If (Not(IsComObjectCreated(hoUrl))) Begin
        Send CreateComObject of hoUrl
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoQuery
    If (Not(IsComObjectCreated(hoQuery))) Begin
        Send CreateComObject of hoQuery
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoNumber
    If (Not(IsComObjectCreated(hoNumber))) Begin
        Send CreateComObject of hoNumber
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoHost
    If (Not(IsComObjectCreated(hoHost))) Begin
        Send CreateComObject of hoHost
    End
    Get Create (RefClass(cComChilkatStringBuilder)) To hoUri
    If (Not(IsComObjectCreated(hoUri))) Begin
        Send CreateComObject of hoUri
    End
    Get Create (RefClass(cComChilkatXml)) To hoXml
    If (Not(IsComObjectCreated(hoXml))) Begin
        Send CreateComObject of hoXml
    End

    Get ComAppend Of hoHost sBucketName To iSuccess
    Get ComAppend Of hoHost "." To iSuccess
    Get ComGetAsString Of hoEndpoint To sTemp1
    Get ComAppend Of hoHost sTemp1 To iSuccess
    Get ComAppend Of hoUri "/" To iSuccess
    Get Create (RefClass(cComChilkatHashtable)) To hoSeen
    If (Not(IsComObjectCreated(hoSeen))) Begin
        Send CreateComObject of hoSeen
    End
    Move True To iMore
    Move 0 To iPage
    Move "" To sMarker

    Move "" To sKeyMarker
    Move "" To sUploadMarker
    Get Create (RefClass(cComChilkatJsonObject)) To hoCursor
    If (Not(IsComObjectCreated(hoCursor))) Begin
        Send CreateComObject of hoCursor
    End
    While (iMore = True)
        If (iPage = 10000) Begin
            Showln "Page bound reached; results are incomplete."
            Procedure_Return
        End

        Move (iPage + 1) To iPage
        Send ComClear To hoQuery
        Get ComLength Of hoQuery To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoQuery "&" To iSuccess
        End

        Get ComAppend Of hoQuery "encoding-type=" To iSuccess
        Get ComUrlEncode Of hoHttp "url" To sTemp1
        Get ComAppend Of hoQuery sTemp1 To iSuccess
        Get ComSetString Of hoStringCompare sKeyMarker To iSuccess
        Get ComContentsEqual Of hoStringCompare "" True To iStringMatch4
        If (iStringMatch4 <> True) Begin
            Get ComLength Of hoQuery To iTemp1
            If (iTemp1 > 0) Begin
                Get ComAppend Of hoQuery "&" To iSuccess
            End

            Get ComAppend Of hoQuery "key-marker=" To iSuccess
            Get ComUrlEncode Of hoHttp sKeyMarker To sTemp1
            Get ComAppend Of hoQuery sTemp1 To iSuccess
        End

        Get ComLength Of hoQuery To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoQuery "&" To iSuccess
        End

        Get ComAppend Of hoQuery "max-uploads=" To iSuccess
        Get ComUrlEncode Of hoHttp "1000" To sTemp1
        Get ComAppend Of hoQuery sTemp1 To iSuccess
        Get ComSetString Of hoStringCompare sUploadMarker To iSuccess
        Get ComContentsEqual Of hoStringCompare "" True To iStringMatch5
        If (iStringMatch5 <> True) Begin
            Get ComLength Of hoQuery To iTemp1
            If (iTemp1 > 0) Begin
                Get ComAppend Of hoQuery "&" To iSuccess
            End

            Get ComAppend Of hoQuery "upload-id-marker=" To iSuccess
            Get ComUrlEncode Of hoHttp sUploadMarker To sTemp1
            Get ComAppend Of hoQuery sTemp1 To iSuccess
        End

        Get ComLength Of hoQuery To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoQuery "&" To iSuccess
        End

        Get ComAppend Of hoQuery "uploads=" To iSuccess
        Get ComUrlEncode Of hoHttp "" To sTemp1
        Get ComAppend Of hoQuery sTemp1 To iSuccess
        Send ComClearHeaders To hoHttp
        Get ComSetFromCurrentSystemTime Of hoNow To iSuccess
        If (iSuccess <> True) Begin
            Showln "Could not read system time."
            Procedure_Return
        End

        Get ComGetAsTimestamp Of hoNow False To sTemp1
        Get ComSetString Of hoTimestamp sTemp1 To iSuccess
        Get ComReplace Of hoTimestamp "-" "" To iReplaceCount
        Get ComReplace Of hoTimestamp ":" "" To iReplaceCount
        Get ComGetAsString Of hoTimestamp To sAmzDate
        Get ComGetRange Of hoTimestamp 0 8 False To sDateStamp
        Get ComHashStringENC Of hoSigner "" To sPayloadHash
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not hash payload."
            Procedure_Return
        End

        Send ComClear To hoCanonicalHeaders
        Send ComClear To hoSignedHeaders
        Get ComLength Of hoSignedHeaders To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoSignedHeaders ";" To iSuccess
        End

        Get ComAppend Of hoSignedHeaders "host" To iSuccess
        Get ComAppend Of hoCanonicalHeaders "host:" To iSuccess
        Get ComGetAsString Of hoHost To sTemp1
        Get ComAppend Of hoCanonicalHeaders sTemp1 To iSuccess
        Get ComAppend Of hoCanonicalHeaders (character(10)) To iSuccess
        Get ComGetAsString Of hoHost To sTemp1
        Send ComSetRequestHeader To hoHttp "host" sTemp1
        Get ComLength Of hoSignedHeaders To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoSignedHeaders ";" To iSuccess
        End

        Get ComAppend Of hoSignedHeaders "x-amz-content-sha256" To iSuccess
        Get ComAppend Of hoCanonicalHeaders "x-amz-content-sha256:" To iSuccess
        Get ComAppend Of hoCanonicalHeaders sPayloadHash To iSuccess
        Get ComAppend Of hoCanonicalHeaders (character(10)) To iSuccess
        Send ComSetRequestHeader To hoHttp "x-amz-content-sha256" sPayloadHash
        Get ComLength Of hoSignedHeaders To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoSignedHeaders ";" To iSuccess
        End

        Get ComAppend Of hoSignedHeaders "x-amz-date" To iSuccess
        Get ComAppend Of hoCanonicalHeaders "x-amz-date:" To iSuccess
        Get ComAppend Of hoCanonicalHeaders sAmzDate To iSuccess
        Get ComAppend Of hoCanonicalHeaders (character(10)) To iSuccess
        Send ComSetRequestHeader To hoHttp "x-amz-date" sAmzDate
        Get ComHasMember Of hoCredentials "session_token" To bTemp1
        If (bTemp1 = True) Begin
            Get ComLength Of hoSignedHeaders To iTemp1
            If (iTemp1 > 0) Begin
                Get ComAppend Of hoSignedHeaders ";" To iSuccess
            End

            Get ComAppend Of hoSignedHeaders "x-amz-security-token" To iSuccess
            Get ComAppend Of hoCanonicalHeaders "x-amz-security-token:" To iSuccess
            Get ComStringOf Of hoCredentials "session_token" To sTemp1
            Get ComAppend Of hoCanonicalHeaders sTemp1 To iSuccess
            Get ComAppend Of hoCanonicalHeaders (character(10)) To iSuccess
            Get ComStringOf Of hoCredentials "session_token" To sTemp1
            Send ComSetRequestHeader To hoHttp "x-amz-security-token" sTemp1
        End

        Send ComClear To hoCanonical
        Get ComAppend Of hoCanonical "GET" + (character(10)) To iSuccess
        Get ComGetAsString Of hoUri To sTemp1
        Get ComAppend Of hoCanonical sTemp1 To iSuccess
        Get ComAppend Of hoCanonical (character(10)) To iSuccess
        Get ComGetAsString Of hoQuery To sTemp1
        Get ComAppend Of hoCanonical sTemp1 To iSuccess
        Get ComAppend Of hoCanonical (character(10)) To iSuccess
        Get ComGetAsString Of hoCanonicalHeaders To sTemp1
        Get ComAppend Of hoCanonical sTemp1 To iSuccess
        Get ComAppend Of hoCanonical (character(10)) To iSuccess
        Get ComGetAsString Of hoSignedHeaders To sTemp1
        Get ComAppend Of hoCanonical sTemp1 To iSuccess
        Get ComAppend Of hoCanonical (character(10)) To iSuccess
        Get ComAppend Of hoCanonical sPayloadHash To iSuccess
        Get ComGetAsString Of hoCanonical To sTemp1
        Get ComHashStringENC Of hoSigner sTemp1 To sCanonicalHash
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not hash canonical request."
            Procedure_Return
        End

        Send ComClear To hoScope
        Get ComAppend Of hoScope sDateStamp To iSuccess
        Get ComAppend Of hoScope "/" To iSuccess
        Get ComAppend Of hoScope sRegion To iSuccess
        Get ComAppend Of hoScope "/s3/aws4_request" To iSuccess
        Send ComClear To hoStringToSign
        Get ComAppend Of hoStringToSign "AWS4-HMAC-SHA256" + (character(10)) To iSuccess
        Get ComAppend Of hoStringToSign sAmzDate To iSuccess
        Get ComAppend Of hoStringToSign (character(10)) To iSuccess
        Get ComGetAsString Of hoScope To sTemp1
        Get ComAppend Of hoStringToSign sTemp1 To iSuccess
        Get ComAppend Of hoStringToSign (character(10)) To iSuccess
        Get ComAppend Of hoStringToSign sCanonicalHash To iSuccess
        Get ComSetString Of hoSigningKey "AWS4" To iSuccess
        Get ComStringOf Of hoCredentials "secret_key" To sTemp1
        Get ComAppend Of hoSigningKey sTemp1 To iSuccess
        Get ComGetAsString Of hoSigningKey To sTemp1
        Get ComSetMacKeyString Of hoSigner sTemp1 To iSuccess
        If (iSuccess <> True) Begin
            Showln "Could not set signing key."
            Procedure_Return
        End

        Get ComMacStringENC Of hoSigner sDateStamp To sDerivedKey
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not derive signing key."
            Procedure_Return
        End

        Get ComSetMacKeyEncoded Of hoSigner sDerivedKey "hex" To iSuccess
        If (iSuccess <> True) Begin
            Showln "Could not set signing key."
            Procedure_Return
        End

        Get ComMacStringENC Of hoSigner sRegion To sDerivedKey
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not derive signing key."
            Procedure_Return
        End

        Get ComSetMacKeyEncoded Of hoSigner sDerivedKey "hex" To iSuccess
        If (iSuccess <> True) Begin
            Showln "Could not set signing key."
            Procedure_Return
        End

        Get ComMacStringENC Of hoSigner "s3" To sDerivedKey
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not derive signing key."
            Procedure_Return
        End

        Get ComSetMacKeyEncoded Of hoSigner sDerivedKey "hex" To iSuccess
        If (iSuccess <> True) Begin
            Showln "Could not set signing key."
            Procedure_Return
        End

        Get ComMacStringENC Of hoSigner "aws4_request" To sDerivedKey
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not derive signing key."
            Procedure_Return
        End

        Get ComSetMacKeyEncoded Of hoSigner sDerivedKey "hex" To iSuccess
        If (iSuccess <> True) Begin
            Showln "Could not set signing key."
            Procedure_Return
        End

        Get ComGetAsString Of hoStringToSign To sTemp1
        Get ComMacStringENC Of hoSigner sTemp1 To sSignature
        Get ComLastMethodSuccess Of hoSigner To bTemp1
        If (bTemp1 <> True) Begin
            Showln "Could not sign request."
            Procedure_Return
        End

        Send ComClear To hoAuthorization
        Get ComAppend Of hoAuthorization "AWS4-HMAC-SHA256 Credential=" To iSuccess
        Get ComStringOf Of hoCredentials "access_key" To sTemp1
        Get ComAppend Of hoAuthorization sTemp1 To iSuccess
        Get ComAppend Of hoAuthorization "/" To iSuccess
        Get ComGetAsString Of hoScope To sTemp1
        Get ComAppend Of hoAuthorization sTemp1 To iSuccess
        Get ComAppend Of hoAuthorization ", SignedHeaders=" To iSuccess
        Get ComGetAsString Of hoSignedHeaders To sTemp1
        Get ComAppend Of hoAuthorization sTemp1 To iSuccess
        Get ComAppend Of hoAuthorization ", Signature=" To iSuccess
        Get ComAppend Of hoAuthorization sSignature To iSuccess
        Get ComGetAsString Of hoAuthorization To sTemp1
        Send ComSetRequestHeader To hoHttp "Authorization" sTemp1
        Get ComSetString Of hoUrl "https://" To iSuccess
        Get ComGetAsString Of hoHost To sTemp1
        Get ComAppend Of hoUrl sTemp1 To iSuccess
        Get ComGetAsString Of hoUri To sTemp1
        Get ComAppend Of hoUrl sTemp1 To iSuccess
        Get ComLength Of hoQuery To iTemp1
        If (iTemp1 > 0) Begin
            Get ComAppend Of hoUrl "?" To iSuccess
            Get ComGetAsString Of hoQuery To sTemp1
            Get ComAppend Of hoUrl sTemp1 To iSuccess
        End

        Get ComGetAsString Of hoUrl To sTemp1
        Get pvComObject of hoResponse to vResponse
        Get ComHttpNoBody Of hoHttp "GET" sTemp1 vResponse To iSuccess
        Get ComStatusCode Of hoResponse To iTemp1
        If ((iSuccess <> True) Or (iTemp1 <> 200)) Begin
            Get ComStatusCode Of hoResponse To iTemp1
            Showln "Request failed or returned unexpected HTTP status: " iTemp1
            //  Preserve progress. Inspect full diagnostics privately; do not log secrets.
            Procedure_Return
        End

        Get ComBodyStr Of hoResponse To sTemp1
        Get ComLoadXml Of hoXml sTemp1 To iSuccess
        If (iSuccess <> True) Begin
            Showln "Invalid XML response."
            Procedure_Return
        End

        Get ComTag Of hoXml To sTemp1
        Get ComSetString Of hoStringCompare sTemp1 To iSuccess
        Get ComContentsEqual Of hoStringCompare "ListMultipartUploadsResult" True To iStringMatch6
        If (iStringMatch6 <> True) Begin
            Showln "Unexpected XML result, possibly an embedded S3 error. Inspect privately."
            Procedure_Return
        End

        Get ComGetChildContent Of hoXml "EncodingType" To sTemp1
        Get ComSetString Of hoStringCompare sTemp1 To iSuccess
        Get ComContentsEqual Of hoStringCompare "url" True To iStringMatch7
        If (iStringMatch7 <> True) Begin
            Showln "Expected URL encoding."
            Procedure_Return
        End

        Move 0 To i
        While (i < (ComNumChildrenHavingTag(hoXml, "Upload")))
            Set ComI Of hoXml To i
            Get ComGetChildContent Of hoXml "Upload[i]|Key" To sItem
            Get ComSetString Of hoStringCompare sItem To iSuccess
            Get ComContentsEqual Of hoStringCompare "" True To iStringMatch8
            Get ComLastMethodSuccess Of hoXml To bTemp1
            If ((bTemp1 <> True) Or (iStringMatch8 = True)) Begin
                Showln "Missing required Upload[i]|Key."
                Procedure_Return
            End

            Get ComUrlDecode Of hoHttp sItem To sTemp1
            Showln "Key: " sTemp1
            Get ComGetChildContent Of hoXml "Upload[i]|UploadId" To sItem
            Get ComSetString Of hoStringCompare sItem To iSuccess
            Get ComContentsEqual Of hoStringCompare "" True To iStringMatch9
            Get ComLastMethodSuccess Of hoXml To bTemp1
            If ((bTemp1 <> True) Or (iStringMatch9 = True)) Begin
                Showln "Missing required Upload[i]|UploadId."
                Procedure_Return
            End

            Showln "Upload ID: " sItem
            Move (i + 1) To i
        Loop

        Get ComGetChildContent Of hoXml "IsTruncated" To sTruncated
        Get ComSetString Of hoStringCompare sTruncated To iSuccess
        Get ComContentsEqual Of hoStringCompare "" True To iStringMatch10
        Get ComLastMethodSuccess Of hoXml To bTemp1
        If ((bTemp1 <> True) Or (iStringMatch10 = True)) Begin
            Showln "Missing required IsTruncated."
            Procedure_Return
        End

        Get ComSetString Of hoStringCompare sTruncated To iSuccess
        Get ComContentsEqual Of hoStringCompare "true" True To iStringMatch11
        Get ComSetString Of hoStringCompare sTruncated To iSuccess
        Get ComContentsEqual Of hoStringCompare "false" True To iStringMatch12
        If ((iStringMatch11 <> True) And (iStringMatch12 <> True)) Begin
            Showln "Invalid IsTruncated."
            Procedure_Return
        End

        Move False To iMore
        Get ComSetString Of hoStringCompare sTruncated To iSuccess
        Get ComContentsEqual Of hoStringCompare "true" True To iStringMatch13
        If (iStringMatch13 = True) Begin
            Get ComGetChildContent Of hoXml "NextKeyMarker" To sKeyMarker
            Get ComSetString Of hoStringCompare sKeyMarker To iSuccess
            Get ComContentsEqual Of hoStringCompare "" True To iStringMatch14
            Get ComLastMethodSuccess Of hoXml To bTemp1
            If ((bTemp1 <> True) Or (iStringMatch14 = True)) Begin
                Showln "Missing required NextKeyMarker."
                Procedure_Return
            End

            Get ComUrlDecode Of hoHttp sKeyMarker To sKeyMarker
            Move "" To sUploadMarker
            Get ComHasChildWithTag Of hoXml "NextUploadIdMarker" To bTemp1
            If (bTemp1 = True) Begin
                Get ComGetChildContent Of hoXml "NextUploadIdMarker" To sUploadMarker
            End

            Get ComUpdateString Of hoCursor "key" sKeyMarker To iSuccess
            If (iSuccess <> True) Begin
                Showln "Could not save key."
                Procedure_Return
            End

            Get ComUpdateString Of hoCursor "upload" sUploadMarker To iSuccess
            If (iSuccess <> True) Begin
                Showln "Could not save upload."
                Procedure_Return
            End

            Get ComEmit Of hoCursor To sMarker
            Get ComContains Of hoSeen sMarker To bTemp1
            If (bTemp1 = True) Begin
                Showln "Repeated multipart cursor."
                Procedure_Return
            End

            Get ComAddStr Of hoSeen sMarker "seen" To iSuccess
            If (iSuccess <> True) Begin
                Showln "Could not track cursor."
                Procedure_Return
            End

            Move True To iMore
        End

    Loop

    Showln "Multipart upload listing complete."


End_Procedure