Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBM MobileFirst Java Adapter (Hybrid Application) download huge file

I'm trying to pull a 20MB file from 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, it shows the following error in JSON format:

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

Is there any data size limitation for Java adapter which data size cannot more than 10 MB?

Remarks: Code below is my Java Adapter sample 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();
} 
like image 233
Wong Chee Ming Avatar asked Nov 08 '22 12:11

Wong Chee Ming


1 Answers

From MobileFirst-perspective, Java adapters impose no such file size limits. I suggest to consider a network issue, such as some vendor your request is going through that imposes this limitation.

like image 65
Idan Adar Avatar answered Dec 23 '22 16:12

Idan Adar