I tried the following:
filePath = sourcePath + "ash.jpg"; byte[] fileContent = FileUtils.readFileToByteArray(new File(filePath)); String encodedStr