basic function: base64 encode a file