I'm having trouble reading the value from a Web Forms For Marketeers Upload File field within my Custom Save Action. As I understand it I should just be able to do this in the Save action Execute method like so (note: my field name is 'Upload' on the form):
public override void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext = null, params object[] data)
{
var fileUpload = adaptedFields.GetEntryByName("Upload");
}
I'm expecting the value to be an item id to the file uploaded but it is null.
I've looked at the out of the box ProcessMessage pipeline and the AddAttachments() method does something similar as it loops through each field in the form (AdaptedControlResult) and then grabs field.Value.
Jonathan Robins also does something similar in his blog post here: https://jonathanrobbins.co.uk/2015/02/18/sitecore-web-forms-for-marketers-send-email-with-attachment-save-action/
So it looks like what I'm doing is right but I've no idea why the value is null and how to resolve this. Any help would be appreciated.