Problem was in the download servlet, not the base64 decoder