Skip to content

Commit

Permalink
Increased the upload file size limit. Fixed issue with null metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
payammeyer committed Jan 31, 2020
1 parent 0135a75 commit 5033ad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions zulia-client/src/main/java/io/zulia/client/ZuliaRESTClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@ public void storeAssociated(String uniqueId, String indexName, String fileName,

String url = HttpHelper.createRequestUrl(server, restPort, ZuliaConstants.ASSOCIATED_DOCUMENTS_URL, null);
try (HttpClient client = HttpClient.create(new URI(url).toURL())) {
MultipartBody requestBody = MultipartBody.builder().addPart("id", uniqueId).addPart("index", indexName).addPart("fileName", fileName)
.addPart("metaJson", metadata != null ? metadata.toJson() : null).addPart("file", fileName, MediaType.forFilename(fileName), source, 0)
.build();
client.toBlocking().exchange(HttpRequest.POST(url, requestBody).contentType(MediaType.MULTIPART_FORM_DATA), String.class);
MultipartBody.Builder builder = MultipartBody.builder().addPart("id", uniqueId).addPart("index", indexName).addPart("fileName", fileName)
.addPart("file", fileName, MediaType.forFilename(fileName), source, 0);

if (metadata != null) {
builder.addPart("metaJson", metadata.toJson());
}

client.toBlocking().exchange(HttpRequest.POST(url, builder.build()).contentType(MediaType.MULTIPART_FORM_DATA), String.class);
}

}
Expand Down
4 changes: 4 additions & 0 deletions zulia-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ micronaut:
enabled: true
netty:
log-level: TRACE
multipart:
max-file-size: 1024MB
max-request-size: 250MB
enabled: true
application:
name: zulia-service
router:
Expand Down

0 comments on commit 5033ad8

Please sign in to comment.