encoding file to base64