IBM MobileFirst Java Adapter (hybrid application) downloads a huge file

I am trying to pull a 20 MB file from an MFP server. So, I wrote the following code in my client application.

var resourceRequest = new WLResourceRequest("/adapters/AdapterExample/users/getUpdate",WLResourceRequest.POST); resourceRequest.send().then(function(result){ Logger("Hello Im here ! : " + result.responseJSON.isSuccessful); },function(error){ Logger("Im error ! : " + error); }); 

Unfortunately, the following error is displayed in JSON format:

JSON Result: {"isSuccessful": false, "errors": [" Data size exceeds the maximum allowable value of 10Mb." ]}

Is there a data size limit for the Java adapter, a size of no more than 10 MB?

Notes: The code below is a sample Java Adapter code:

 @POST @Path("/getUpdate") public String getUpdate() throws IOException{ JSONObject obj = new JSONObject(); java.nio.file.Path path = Paths.get("/Users/abc/Documents/example.zip"); byte[] fileData = Files.readAllBytes(path); obj.put("fileName", path.getFileName().toString()); obj.put("size", Base64.encodeBase64String(fileData).length()); return obj.toString(); } 
+5
source share
1 answer

From the point of view of MobileFirst, Java adapters do not impose such file size restrictions. I propose to consider a network problem, for example, some provider with whom your request passes, which imposes this restriction.

+1
source

All Articles