Fields
File

File field

Display type

  • file

Config

NameDescriptionNotes
acceptType of file to be acceptedFor example: image/jpeg,image/png
filePreviewWhether to preview file in display. Enabled for images onlyType: boolean
blobWhether to submit data in binary format on form submission. Else it will be converted to base64 formatType: boolean
multipleWhether to allow multiple file uploadsType: boolean

Basic example

Schema Details

{
fields
:
[
0
:
{
name
:
"aadhaar-file-details"
prop
:
"aadhaar-card"
meta
:
{
type
:
"section"
displayName
:
"Aadhaar Card"
}
fields
:
[
0
:
{
name
:
"aadhaar_header"
prop
:
NULL
meta
:
{
…
}
}
1
:
{
name
:
"aadhaar_file_front"
meta
:
{
…
}
}
2
:
{
name
:
"aadhaar_file_back"
meta
:
{
…
}
}
]
}
1
:
{
name
:
"pan-file-details"
prop
:
"pancard"
meta
:
{
type
:
"section"
displayName
:
"Pan Card"
}
fields
:
[
0
:
{
name
:
"pan-card-header"
prop
:
NULL
meta
:
{
…
}
}
1
:
{
name
:
"pancard_file"
meta
:
{
…
}
}
]
}
]
buttons
:
[
0
:
{
name
:
"previous"
meta
:
{
type
:
"previous"
}
}
1
:
{
name
:
"next"
meta
:
{
className
:
"bg-gray-800"
type
:
"next"
}
}
2
:
{
name
:
"submit"
meta
:
{
type
:
"submit"
className
:
"bg-gray-800"
}
}
]
}

Example: upload multiple images with preview

Schema Details

{
fields
:
[
0
:
{
name
:
"upload-photos"
meta
:
{
config
:
{
accept
:
"image/jpeg,image/png"
filePreview
:
true
multiple
:
true
blob
:
true
}
displayType
:
"file"
displayName
:
"Upload photos"
}
}
]
}

Star us at github

© Copyright 2023 MuiForms