File Upload
Formsatlas-file-uploadExamples
Drop zone
Click or drop files. accept and maxSize filter them; rejected files emit (fileTooLarge) .
Click or drag files to upload
PDF or images up to 2 MB
Images with a size limit
accept filters the file picker, multiple allows several files and maxSize (bytes) rejects big ones: they are left out of the value and reported through (fileTooLarge) . The rejection message sits in a polite live region so screen readers announce it.
Product photos
PNG or JPG, up to 1 MB each.
A single document
Without multiple , a new file replaces the current one. label and hint name and describe the drop zone; accept takes extensions as well as MIME types.
Signed contract
One PDF file.
No file yet
API
Generated from the library source, so it always matches the code.
AtlasFileUploadComponent atlas-file-upload
| Input | Type | Default | Description |
|---|---|---|---|
| accept | string | '' | |
| multiple | boolean | false | |
| maxSize | number | 0 | |
| label | string | undefined | undefined | fileUpload.label ; '' hides it. |
| hint | string | undefined | undefined | |
| disabled | boolean | false | |
| errors | readonly ValidationError.WithOptionalFieldTree[] | [] | [field] . |
| required | boolean | false | [field] . |
| invalid | boolean | false | [field] . |
| touched | boolean | false | [field] . |
| readonly | boolean | false | [field] . |
| pending | boolean | false | [field] . |
| name | string | '' | [field] . |
| ariaLabel | string | null | null | |
| inputId | string | undefined | undefined | id of the focusable element, so a visible <label atlasLabel for="…"> names it. Inside atlas-form-field the field supplies one. |
| ariaDescribedBy | string | null | null | aria-describedby , merged with the surrounding form field's hint or error. |
| class | string | '' | cn() ; yours win on conflicts. |
| value two-way | UploadedFile[] | [] | [field] ). Files over maxSize are left out and reported through fileTooLarge . |
| Output | Payload | Description |
|---|---|---|
| touch | void | |
| filesAdded | UploadedFile[] | |
| fileRemoved | UploadedFile | |
| fileTooLarge | File |
Types
UploadedFile
| Property | Type | Description |
|---|---|---|
| file | File | |
| name | string | |
| size | number |