Uploading stream to S3 using Java SDK when content length not known

0

I'm in the process of updating a Java application from the 1.x version of the AWS SDK to the latest 2.x version.

My application contains a function that uploads an InputStream to S3. In the 1.x version of the SDK, the function to do this does not require that I pass in a content length. But in the new version, it apparently does.

Unfortunately, the function in question doesn't have access to the content length and I can't find a way to obtain it.

Is this an intentional change? Is there any way I can upload the stream without knowing the content length? For reasons of security, my application is not allowed to process the stream (write it to a file or read it fully into memory).

Thanks, Frank

  • Hello, have you found a solution to this problem? Thanks.

Frank
asked 2 years ago121 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions