Skip to main content

File

The <sdpi-file> component provides a styled wrapper of <input type="file">.

Example​

Property Inspector HTML
<sdpi-item label="File">
<sdpi-file setting="avatar" accept="image/png, image/jpeg"></sdpi-file>
</sdpi-item>

Result​

A file input in the Stream Deck property inspector using the sdpi-file web component

value

The value of <sdpi-file> is represented as a string.

{
"avatar": "C:\\Users\\Richard\\Pictures\\Profile.png"
}

Configuration​

The component supports the following configuration.

NameTypeDescription
acceptstringThe types of files that can be selected; directly mapped to the input's accept attribute.
disabledbooleanDetermines whether the input is disabled.
labelstringOptional label displayed in the button used to activate the file selector (default ...).
valuestringThe value of the component, and the persisted setting.

Persistence​

The value of the component can be automatically persisted to the Stream Deck with the following configuration.

NameTypeDescription
globalbooleanWhen present, the value will be persisted to the global settings.
settingstringThe path of the property where the value should be persisted in the settings.
setting

The setting represents the path of a property. If required, this path can denote a nested property within the settings, e.g. if the setting were foo.bar.prop, the value would be saved to:

{
"foo": {
"bar": {
"prop": <value>
}
}
}