Reference Field Reference
fields.file()
Single file upload. Never localizable.
Single file upload. Maps to editor { name: 'str-file', type: 'file' }. Output is the canonical FileValue from @strifeapp/types: { name, size, type, extension, src, draft }.
Example
fields.file({
label: 'Attachment',
allowedTypes: 'application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document',
})Options
| Option | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Label shown to editors in Strife Studio. |
description | string | No | Shown as hover text on the field's name. |
searchable | boolean | No | Stored on the template; nothing uses it today. |
filterable | boolean | No | Stored on the template; nothing uses it today. |
protected | boolean | No | Stops the field from being edited or removed in Studio's template designer. No effect in the editor panel. |
propertyName | string | No | Override the stored property name. |
allowedTypes | string | null | No | Comma-separated MIME types, such as application/pdf. Studio accepts a file only when its type matches one exactly: extensions such as .pdf never match, and without allowedTypes every file is rejected. |
No localizable option. Strife Studio's file field takes files up to 4 MB. The new interface doesn't show file fields yet.
Output type
FileValue ({ name, size, type, extension, src, draft }).
See also
- File: the same editor, documented from the Strife Studio UI side.