You’ll need to download the Community Commons module from the Marketplace. In there you’ll find Base64DecodeToFile and Base64EncodeToFile that should do exactly what you need. Hope this helps