Trying to decode base64 file on GNU/Linux, I get \"base64: invalid input\".
$ base64 test.zip | base64 -d > test2.zip base64: invalid input $ ll test* -rw-r--
If you're doing this on a mac, your version of base64 might not have the flexibility to handle ignoring garbage. If you brew install coreutils, you'll have the gbase64 utility and use it as Joe has described.
base64
coreutils
gbase64