File input element
Welcome to the new home of Slack developer docs!
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Fields
Fields | Type | Description | Required? |
---|---|---|---|
type | String | The type of element. In this case type is always file_input . | Required |
action_id | String | An identifier for the input value when the parent modal is submitted. You can use this when you receive a view_submission payload to identify the value of the input element. Should be unique among all other action_id s in the containing block. Maximum length is 255 characters. | Optional |
filetypes | String[] | An array of valid file extensions that will be accepted for this element. All file extensions will be accepted if filetypes is not specified. This validation is provided for convenience only, and you should perform your own file type validation based on what you expect to receive. | Optional |
max_files | Integer | Maximum number of files that can be uploaded for this file_input element. Minimum of 1, maximum of 10. Defaults to 10 if not specified. | Optional |
Usage info
In order to use the file_input
element within your app, your app must have the files:read
scope. There is a 10MB file size limit.
Example
An input block containing a file_input
input element.
{
"type": "input",
"block_id": "input_block_id",
"label": {
"type": "plain_text",
"text": "Upload Files"
},
"element": {
"type": "file_input",
"action_id": "file_input_action_id_1",
"filetypes": ["jpg", "png"],
"max_files": 5,
},
}