【问题标题】:How to make user send image attachment in botframework如何让用户在 botframework 中发送图像附件
【发布时间】:2018-05-26 00:47:58
【问题描述】:
[Serializable]
public class VehicleForm
{
    [Prompt("When did this happen")]
    public DateTime LossDate { get; set; }

    [Prompt("Please upload proof image")]
    public byte Picture { get; set; }

我希望用户在机器人框架中填写表单时能够包含图像。我将图片字段声明为字节,但上传图片时不起作用。这有可能实现吗?如果是,请任何人向我简要介绍如何去做?谢谢

【问题讨论】:

标签: c# botframework


【解决方案1】:

有一个sample in the SDK Repository 可以做到这一点。

从示例看来,您需要使用AwaitableAttachment 类型,看看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;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-01
    • 1970-01-01
    • 2021-07-05
    • 2011-11-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多