gpt4 book ai didi

ibm-mobilefirst - IBM MobileFirst Java Adapter (Hybrid Application) 下载大文件

转载 作者:行者123 更新时间:2023-12-04 07:19:45 30 4
gpt4 key购买 nike

我正在尝试从 MFP 服务器中提取一个 20MB 的文件。所以,我在我的客户端应用程序中编写了以下代码。

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);
});

不幸的是,它以 JSON 格式显示以下错误:

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



数据大小不能超过 10 MB 的 Java 适配器是否有数据大小限制?

备注:下面的代码是我的 Java Adapter 示例代码:
@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();
}

最佳答案

从 MobileFirst 的角度来看,Java 适配器没有施加此类文件大小限制。我建议考虑网络问题,例如您的请求正在通过的某些供应商强加了此限制。

关于ibm-mobilefirst - IBM MobileFirst Java Adapter (Hybrid Application) 下载大文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38500144/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com