Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Converting from Base64

$
0
0

Hi,

I'm currently pulling down a Base64 string from an API and converting the string into a file.

$Base64 = [Convert]::FromBase64String($Data)
[IO.File]::WriteAllBytes($File, $Data) 

This has worked great but I recently came across a string that I couldn't convert and got the below error. 

Unable to process Base64 string Exception calling "FromBase64String" with "1" argument(s): "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
. "

How do you go about troubleshooting this? When I plug the string into an online converter it doesn't give me any errors. The string doesn't have any header information.

Thanks


Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>