private String uploadBase64FileToBucket(String base64Image) throws Exception {
  Base64 base64=new Base64();
  byte[] bytes=base64.decode(base64Image.getBytes());
  File tempFile=File.createTempFile("taxReceipt",".jpg");
  FileOutputStream fileOutputStream=new FileOutputStream(tempFile);
  fileOutputStream.write(bytes);
  fileOutputStream.flush();
  fileOutputStream.close();
  String s3OutputFileName=uploadFileToBucket(tempFile);
  tempFile.deleteOnExit();
  return s3OutputFileName;
}

private String uploadBase64FileToBucket ( String base64Image ) throws Exception { Base64 base64 = new Base64 ( ) ; byte [ ] bytes = base64 . decode ( base64Image . getBytes ( ) ) ; File tempFile = File . createTempFile ( "taxReceipt" , ".jpg" ) ; FileOutputStream fileOutputStream = new FileOutputStream ( tempFile ) ; fileOutputStream . write ( bytes ) ; fileOutputStream . flush ( ) ; fileOutputStream . close ( ) ; String s3OutputFileName = uploadFileToBucket ( tempFile ) ; tempFile . deleteOnExit ( ) ; return s3OutputFileName ; }
upload an image encoded in base64 to a aws bucket
