java - How to convert a multipart file to File? - Stack Overflow
https://stackoverflow.com/questions/24339990/how-to-convert-a-multipart-file-to-file
WEBDec 29, 2016 · 11 Answers. Sorted by: 206. You can get the content of a MultipartFile by using the getBytes method and you can write to the file using Files.newOutputStream(): public void write(MultipartFile file, Path dir) { Path filepath = Paths.get(dir.toString(), file.getOriginalFilename()); try (OutputStream os = Files.newOutputStream(filepath)) {
DA: 5 PA: 82 MOZ Rank: 93