Base64 decoding issue on Java server
I am working on the client side and I am facing problems in encoding/decoding data. The decoded string received at server is different from the string sent by the client. I can't figure out wh开发者_JAVA百科at might be the problem. Has anyone encountered this problem before? Is there something wrong at server or have I done something wrong?
I checked the result for for some string "abc" at my own end and I am getting the correct result. But when server does the decoding, it shows different result.
For Base64 I used this.
Nitish i think now the fault you doing is in the sending it to server if both approach are using on client and server end then it will be a fault in the http message sending to server cross check that thing i think you will get the result.
How are you decoding on server side. which APIs are you using ? You may want to look to Commons Codec. Also you can look at this discussion for base64 encode/decode in java
精彩评论