2

我们正在寻找使用 orbot 上传图像的解决方案。我们正在使用 Android 客户端来实现它,并使用服务器端 Spring Boot。当我们上传图片(3 张或更多图片)时,即使上传了图片,我们也会在 Android 中获得 Socket Exception。

这是 Spring 的示例代码:

public @ResponseBody Response addAttachments(@ModelAttribute("atForm") AtForm atForm, @RequestHeader(value="ts", required=false) String ts) throws Exception {
Response res = new Respose();
    saveAttachments(atForm.getAtachments(), ts);
    return response;
}

private void saveAttachments(MultipartFile[] attachments, String ts) {
    if(attachments!=null && attachments.length > 0) {
        for(MultipartFile file : attachments){
            saveFile(file);
        }
    }
}

public String saveFile(MultipartFile mFile) throws IOException {
    File convFile = new File(PATH+mFile.getOriginalName());
    FileCopyUtils.copy(mFile.getBytes(), convFile);
    return fileName.toString();
}
4

1 回答 1

0


                 经过几天的测试我们发现,这个问题与网络速度有关,并且工作正常是网络速度很好。所以 orbot 网络不能在慢速网络上工作。

谢谢,
欧普

于 2017-01-01T07:58:34.483 回答