Spring boot 使用orbot的Spring引导上载映像
我们正在寻找使用orbot上传图像的解决方案。我们使用Android客户端来实现它,并使用服务器端spring boot。当我们上传图片(3张或更多图片)时,即使上传图片,Android系统也会出现套接字异常 以下是Spring的示例代码:Spring boot 使用orbot的Spring引导上载映像,spring-boot,orbot,Spring Boot,Orbot,我们正在寻找使用orbot上传图像的解决方案。我们使用Android客户端来实现它,并使用服务器端spring boot。当我们上传图片(3张或更多图片)时,即使上传图片,Android系统也会出现套接字异常 以下是Spring的示例代码: public @ResponseBody Response addAttachments(@ModelAttribute("atForm") AtForm atForm, @RequestHeader(value="ts", required=false)
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();
}
我们花了几天的时间对其进行测试,发现这个问题与网络速度有关,如果网络速度好,工作正常。所以orbot网络不能在慢速网络上工作 谢谢,
Op显示一些代码。。你是如何上传的,你在哪里面临的问题。更新我原来的帖子,请检查。有任何意见??