Examples of close Method with File Properties
Sending Uploaded Content
var file = document.querySelector('input[type=file]').files[0];
window.parent.postMessage
(
{
apiVersion: 1,
method: 'close',
activity:
{
ccity: 'Cleveland',
door_photo:
{
fileName: 'DCIM_20170425_203115.jpg',
fileContents: file
}
}
},
targetOrigin
);
Sending Generated Content
var text =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<test></test>';
var blob = new Blob([text], { type: 'text/xml' });
window.parent.postMessage
(
{
apiVersion: 1,
method: 'close',
activity:
{
ccity: 'Cleveland',
XML_DATA_PROP:
{
fileName: 'test_data.xml',
fileContents: blob
}
}
},
targetOrigin
);