首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用orbot的Spring引导上传映像

使用orbot的Spring引导上传映像
EN

Stack Overflow用户
提问于 2016-12-23 10:44:38
回答 1查看 111关注 0票数 2

我们正在寻找一个解决方案,其中上传图像使用orbot。我们使用Android客户端来实现它,服务器端使用了spring引导。当我们上传图像(3张或更多)时,即使图像被提升,我们也会在Android中获得套接字异常。

以下是Spring的示例代码:

代码语言:javascript
复制
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();
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-01 07:58:34

经过几天的测试,我们发现,这个问题与网络速度有关,工作良好的是网络速度是好的。因此,orbot网络不能在慢网络上工作。

谢谢,

操作

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41299901

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档