Im trying to decode a string that was genearated by:
Javascript code:
fileReader.readAsDataURL(fileToLoad);
Ps.: Its a part of encode a file.
After get the file is encoded, i put inside of Json and send to a restfull service using POST method.
Java code (restfull):
String radiationFilePath = json.getString("radiationFilePath");
String newRadFile = radiationFilePath.replace("\\", ""); \\I read that it is a needed because JsonObject add some '\'
byte[] radiationFileAsBytes = Base64.getDecoder().decode(newRadFile);
Doing that, im receiving an exception:
java.lang.IllegalArgumentException: Illegal base64 character 3a
What should i do?
PS.: Im using Maven to import dependencies