New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using BufferedInputStream
causes an upload error
#2876
Comments
Hi @JavaLionLi can you share a repro code in text format, not screenshot? |
Simply put, PutObjectRequest use BufferedInputStream error |
|
Can you share a code sample of how the s3 client is being created? |
use minio |
I can't reproduce the issue. I used the s3 endpoint though, not minio. Maybe it's a minio issue, do you see the same error when using the s3 endpoint directly? You mentioned Multipart in the description, but the repro code calls a regular non-multipart PutObject, can you share a repro code for Multipart Upload? And if possible, please enable the DEBUG logs and share here when the error occurs. For instructions on how to enable DEBUG logs check Request/Response Summary Logging here: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-logging.html#sdk-net-logging-request-response |
Nothing to do with minio, Using a BufferedInputStream file larger than 500kb will result in an error, The error was reported before it was uploaded |
No one to deal with it? |
I had the same problem in sdk 2.x , So I try use java reflection to get BufferedInputSteam filed in (FileInputStream) and put it . @JavaLionLi InputStream inputStream = file.getInputStream();
Field in = FilterInputStream.class.getDeclaredField("in");
in.setAccessible(true);
InputStream inNew = (InputStream)in.get(inputStream);
PutObjectResponse putObjectResponse = s3Client.putObject(putObjectRequest, RequestBody.fromInputStream(inNew, size)); |
Describe the bug
Upload files to receive using
MultipartFile
MultipartFile.getInputStream
returnBufferedInputStream
Using
BufferedInputStream
causes an upload errorExpected Behavior
use bytes upload success
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
1.12.341
JDK version used
1.8.0_202
Operating System and version
centos7.6
The text was updated successfully, but these errors were encountered: