URL url = new URL("ftp://172.18.251.155:8010/recordsImg/2019-01-28/000008_1548649813267.jpg"); MultipartFile multipartFile = new MockMultipartFile(fileName,fileName,"", url.openStream());