Stay Hungry, Stay Foolish
123456789
private String saveImg(String base64Img) throws IOException { String imgFile = "test.jpg"; try (FileOutputStream fos = new FileOutputStream(imgFile)) { byte[] imageData = Base64.getDecoder().decode(base64Img); fos.write(imageData); fos.flush(); } return imgFile;}