Quote:
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
You code fails because you try to base64 decode a string that is not base64 encoded.
The problem is not in your code, at least not now.
You need to show the offending string to identify the encoding, then, after, change the code to handle the encoding.
As far as I can see, the code in your question is not related to base64 decoding.
[Update]
Quote:
I don't eve know where to start, I tried to follow a few examples on this website and others for base64, and I cant seem to get it to work, it keeps giving the same error.
Run your code on debugger and when you get the error, inspect the variable that is supposed to hold the base64 value and update your question with that value, this way, we can see what you try to decode.
Nota: the only code interesting is where the error occurs.