custominternalfileupload
File upload that pre-uploads to the CDN on selection and sends only the CDN reference in the application payload.
File upload that pre-uploads to the CDN on selection and sends only the CDN reference in the application payload. Use for large or sensitive documents where sending base64 inline would bloat the submission.
Read Form Rules before using this component — keys, labels, required fields, expressions, visibility, and validation all follow shared conventions.
When to use
- Civil registration documents (birth certificates, marriage certificates, death certificates)
- Any document where large or sensitive files should not travel as base64 in the application payload
- The file is stored by IremboHub's CDN — no external integration endpoint is involved
When NOT to use
Instead of custominternalfileupload, use… | For… |
|---|---|
customfileupload | Small attachments that can be sent inline as base64 with the payload |
externalfileupload | Files that must be pushed directly to an external system via an integration endpoint at upload time |
Props
| Prop | Type | Required? | Description |
|---|---|---|---|
label | string | required | Visible label. Must be unique across the form. |
required | boolean | required | Always false. The expression controls the runtime value. |
defaultRequired | boolean | required | true for required fields, false for optional ones. |
allowedFormats | array | required | Accepted file extensions in lowercase (e.g. ["pdf"]). Civil documents are typically PDF only. |
maximumUploadSize | number | required | Maximum file size in KB (civil documents typically 500). |
minimumUploadSize | number | optional | Minimum file size in KB. Use 1 to prevent empty files. |
placeholder | string | optional | Text shown on the upload button. |
hint | string | optional | Help text describing which document is required. |
hideField | boolean | optional | Hides the field and excludes its value. Toggle via expressions["props.hideField"]. |
Validation messages
| Key | When required | Notes |
|---|---|---|
required | Always | |
invalidfileformat | Always | Quote the field label and state accepted formats. |
maximumUploadSize | Always | Quote the field label and state the size limit. |
minimumUploadSize | When minimumUploadSize is set |
Examples
Birth certificate (conditionally required)
{
"key": "BIRTH_CERTIFICATE",
"type": "custominternalfileupload",
"props": {
"label": "Birth Certificate",
"placeholder": "Select file to upload",
"required": false,
"defaultRequired": true,
"allowedFormats": ["pdf"],
"maximumUploadSize": 500
},
"expressions": {
"props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired",
"hide": "!(model?.RELATIONSHIP === 'Child')"
},
"validation": {
"messages": {
"required": "This field is required.",
"invalidfileformat": "\"Birth Certificate\" only accepts PDF format.",
"maximumUploadSize": "\"Birth Certificate\" must be smaller than 500 KB."
}
}
}With minimum size and hint
{
"key": "MARRIAGE_CERTIFICATE",
"type": "custominternalfileupload",
"props": {
"label": "Marriage Certificate",
"placeholder": "Select file to upload",
"required": false,
"defaultRequired": true,
"allowedFormats": ["pdf"],
"maximumUploadSize": 500,
"minimumUploadSize": 1,
"hint": "Upload the marriage certificate of the concerned party."
},
"expressions": {
"props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired"
},
"validation": {
"messages": {
"required": "This field is required.",
"invalidfileformat": "\"Marriage Certificate\" only accepts PDF format.",
"maximumUploadSize": "\"Marriage Certificate\" must be smaller than 500 KB.",
"minimumUploadSize": "\"Marriage Certificate\" must be at least 1 KB."
}
}
}Common mistakes
- Setting
maximumUploadSizein bytes or MB — the prop is always in KB. - Including uppercase variants in
allowedFormats(e.g.["pdf", "PDF"]) — redundant; use lowercase only. - Omitting
allowedFormats— the component accepts any file type; always restrict explicitly. - Using
custominternalfileuploadwhen the file must be pushed to an external endpoint — useexternalfileuploadinstead.
Checklist
-
keyisUPPER_SNAKE_CASEand unique across the entire form -
props.labelis present, unique, and correctly cased - Field is nested at the correct depth:
sections > formly-group > block > custominternalfileupload -
required: falseis set (nevertrue) -
defaultRequiredis set -
expressions["props.required"]is present with the exact required expression -
allowedFormatsis lowercase only (typically["pdf"]for civil documents) -
maximumUploadSizeis in KB -
validation.messageshasrequired,invalidfileformat, andmaximumUploadSize - Validation message text quotes the field label
- Confirmed the document should go to the CDN — if it must go to an external system, use
externalfileupload
customfileupload
Standard citizen document upload. The file is encoded as base64 and sent inline as part of the application payload on submission.
customcascadingdropdowns
A multi-level cascading dropdown for hierarchical selection. Each level filters the options available in the next level based on the parent selection.