Load your binary file into a byte[] array, then use string b64val = Convert.ToBase64String(array) to get the base64 string value. This value is then set to the file attachment field in your form.
thisXDocument.DOM.selectSingleNode("/my:myFields/my:Base64File").text = b64val;