Programmatically inserting a File Upload into a Contour entries table - RecordField
Hi there,
The way we have recently been working with Contour is to have a bespoke form (fluentValidation/Unit testing reasons) that hooks into Contour and saves the records by generating a RecordField from fromo values.
private void GenerateRecordField(Record record, Field field, object value) { Guid key = Guid.NewGuid(); RecordField recordField = new RecordField() { Field = field, Key = key, Record = record.Id, Values = new List<object>() { value } }; var recordFieldStorage = new RecordFieldStorage(); recordFieldStorage.InsertRecordField(recordField); record.RecordFields.Add(key, recordField); }
This has worked brilliantly for text fields but how do I prepare a file upload for Contour.
I have tried passing the HtmlInputFile to the RecordField Value list<object>.
Is there a different type other than RecordField that is needed?
Programmatically inserting a File Upload into a Contour entries table - RecordField
Hi there,
The way we have recently been working with Contour is to have a bespoke form (fluentValidation/Unit testing reasons) that hooks into Contour and saves the records by generating a RecordField from fromo values.
This has worked brilliantly for text fields but how do I prepare a file upload for Contour.
I have tried passing the HtmlInputFile to the RecordField Value list<object>.
Is there a different type other than RecordField that is needed?
Thanks.
Comment author was deleted
Passing a htmlInputFile won't work you'll just need to pass it the path to the file as a string
So you'll have to handle the upload in your own code for the time being since the upload is happening in the upload control
is working on a reply...