Illegal base64 character
问题 I am trying uploading an image with this javascript code: var reader = new FileReader(); reader.onloadend = function() { var bytes = window.btoa(reader.result); var ext = file.name.split(".").pop(); xhr.send("bytes="+bytes+"&type="+ext); } reader.readAsBinaryString(file); where bytes is passed to this java code on the server side: public Integer upload(String bytes, String type) throws IOException { byte[] bytes_final = Base64.getDecoder().decode(bytes.split(",")[1]); BufferedImage src =