Reputation: 85
[Serializable]
public class VehicleForm
{
[Prompt("When did this happen")]
public DateTime LossDate { get; set; }
[Prompt("Please upload proof image")]
public byte Picture { get; set; }
I want a user to be able to include image when filling a form in bot framework. I declared the picture field as byte but didn't work when i upload image. Is this possible to achieve? if yes please can anyone brief me on how to go about it?. Thanks
Upvotes: 2
Views: 463
Reputation: 3426
There is a sample in the SDK Repository for doing exactly this.
From the sample it appears you need to use the AwaitableAttachment
type, take a look at the ImagesForm
:
// Attachment field has no validation - any attachment would work
public AwaitableAttachment BestImage;
// Attachment field is optional - validation is done through AttachmentContentTypeValidator usage
[Optional]
[AttachmentContentTypeValidator(ContentType = "png")]
public AwaitableAttachment SecondaryImage;
Upvotes: 1