【问题标题】:Spring boot upload image using orbotSpring Boot使用orbot上传图片
【发布时间】:2016-12-23 10:44:38
【问题描述】:

我们正在寻找使用 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();
}

【问题讨论】:

  • 显示一些代码 .. 你是如何上传的以及你遇到问题的地方。
  • 更新我的原帖,请查收。
  • 任何 cmets ??

标签: spring-boot orbot


【解决方案1】:


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

谢谢,
操作

【讨论】:

    猜你喜欢
    • 2022-06-14
    • 2018-09-19
    • 1970-01-01
    • 2020-12-17
    • 1970-01-01
    • 2018-01-06
    • 1970-01-01
    • 2022-01-10
    • 2021-04-27
    相关资源
    最近更新 更多