save file in base64 format