Skip to content

Commit

Permalink
fix: Amazon S3 large file uploads issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
“sneha122” committed Sep 27, 2024
1 parent 6368215 commit 2c1e7e1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.external.plugins.exceptions.S3ErrorMessages;
import com.external.plugins.exceptions.S3PluginError;
import com.external.utils.AmazonS3ErrorUtils;
import com.fasterxml.jackson.core.StreamReadConstraints;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.node.ArrayNode;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -262,6 +263,13 @@ String uploadFileFromBody(
byte[] payload;
MultipartFormDataDTO multipartFormDataDTO;
try {
// Multipart data would be parsed using object mapper, these files may be large in the size.
// Hence, the length should not be truncated, therefore allowing maximum length.
objectMapper
.getFactory()
.setStreamReadConstraints(StreamReadConstraints.builder()
.maxStringLength(Integer.MAX_VALUE)
.build());
multipartFormDataDTO = objectMapper.readValue(body, MultipartFormDataDTO.class);
} catch (IOException e) {
throw new AppsmithPluginException(
Expand Down

0 comments on commit 2c1e7e1

Please sign in to comment.