App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Writing a binary file to Amazon S3 bucket

  • 1.  Writing a binary file to Amazon S3 bucket

    Posted Thu October 12, 2023 09:14 AM

    Hi

    ACE 12.0.7

    I'm trying to use a flow to do the following:

    Read a .jpg file from location http://something  -> Compute node to set up JSON Output for input to S3 Connector node  -> S3 Connector node

    I get the .jpg from the website fine (debug shows that it's a binary file beginning with x'ffd8ffe000104a' as expected)

    I set up the Compute node ESQL as follows:

            SET OutputRoot.JSON.Data.Key = abc;
            SET Environment.JSON.Data.BucketName = 'xyz'; (for the override variable in the S3 Connector node)
            SET OutputRoot.JSON.Data.ContentType = 'image/jpeg';
            SET OutputRoot.JSON.Data.content = InputRoot.BLOB.BLOB;

    The output is written successfully to the S3 bucket, but not as a binary file. My check for this is to download the file from the bucket and read it using MS Paint. The open using MS Paint fails - "not a valid bitmap file".

    I also tried setting ContentType = "binary/octet-stream" and "text/plain" - same result.

    How can I write the .jpg file to the S3 bucket as a binary file (i.e. in the same format that I retrieved it from the external website) ?



    ------------------------------
    Peter Von Hirschfeld
    ------------------------------