Can I convert MultipartFile
from the library (org.springframework.web.multipart.MultipartFile
) to a BufferedImage
without first saving it to the local disk? If yes, please tell me how to do it
I used to save to disk and then get a BufferedImage from there, but now I need to do it without saving
CodePudding user response:
Did you try the following?
BufferedImage image = ImageIO.read(multipartFile.getInputStream())