@@ -1624,6 +1624,55 @@ def __init__(
16241624 self .dispatch_action_config = dispatch_action_config
16251625
16261626
1627+ # -------------------------------------------------
1628+ # File Input Element
1629+ # -------------------------------------------------
1630+
1631+
1632+ class FileInputElement (InputInteractiveElement ):
1633+ type = "file_input"
1634+
1635+ @property
1636+ def attributes (self ) -> Set [str ]:
1637+ return super ().attributes .union (
1638+ {
1639+ "filetypes" ,
1640+ "max_files" ,
1641+ }
1642+ )
1643+
1644+ def __init__ (
1645+ self ,
1646+ * ,
1647+ action_id : Optional [str ] = None ,
1648+ filetypes : Optional [List [str ]] = None ,
1649+ max_files : Optional [int ] = None ,
1650+ ** others : dict ,
1651+ ):
1652+ """
1653+ https://api.slack.com/reference/block-kit/block-elements#file_input
1654+
1655+ Args:
1656+ action_id (required): An identifier for the input value when the parent modal is submitted.
1657+ You can use this when you receive a view_submission payload to identify the value of the input element.
1658+ Should be unique among all other action_ids in the containing block. Maximum length is 255 characters.
1659+ filetypes: An array of valid file extensions that will be accepted for this element.
1660+ All file extensions will be accepted if filetypes is not specified.
1661+ This validation is provided for convenience only,
1662+ and you should perform your own file type validation based on what you expect to receive.
1663+ max_files: Maximum number of files that can be uploaded for this file_input element.
1664+ Minimum of 1, maximum of 10. Defaults to 10 if not specified.
1665+ """
1666+ super ().__init__ (
1667+ type = self .type ,
1668+ action_id = action_id ,
1669+ )
1670+ show_unknown_key_warning (self , others )
1671+
1672+ self .filetypes = filetypes
1673+ self .max_files = max_files
1674+
1675+
16271676# -------------------------------------------------
16281677# Radio Buttons Select
16291678# -------------------------------------------------
0 commit comments