InputFile
The InputFile action allows your bot to ask the user to upload a file
(such as an item photo or a document with legal data) and save a link to it into a variable.
Parameters
| Parameter | Type | Description | Required | 
|---|---|---|---|
| prompt | String | The message prompting the user to upload a file. If you intend to use HTML markup in the message, leave this parameter empty ( prompt =) and fill out thehtmlparameter instead. | Yes | 
| varName | String | Variable name. The link to the file sent by the user will be stored in $session.<varName>.Use the following characters: Aa–Zz, _, 0–9. The first character should be a letter. JavaScript reserved words are not allowed. | Yes | 
| html | String | The message prompting the user to upload a file, with HTML markup. If you don’t intend to use HTML markup, omit this parameter and use promptonly. | No | 
| htmlEnabled | Boolean | If set to true, the bot message will use thehtmlparameter value, and the error message will usefailureMessageHtml.If omitted or set to false, thepromptandfailureMessagevalues will be used instead. | No | 
| then | String | The state the dialog will switch to if the tag script completes without errors. | No | 
| errorState | String | The state the dialog will switch to if the tag script fails: for example, if the user sends a regular request instead of a file. | No | 
| actions | Array of objects | Buttons that will be displayed along with the request. Use the following format for the value:  | No | 
How to use
state: AttachFile
    InputFile:
        prompt = Attach a file to the chat, and I’ll upload it to the storage and send you a link.
        varName = fileUrl
        then = /AttachFile/Save
        errorState  = /AttachFile/Error
    state: Save
        a: Success! You can access the file using this link: {{$session.fileUrl}}.
    state: Error
        a: Sorry, I couldn’t process the file.