<div class="ecl-form-group" data-ecl-file-upload-group="true" data-ecl-autoinit="FileUpload"> <div for="example-input-id-1" id="example-input-id-1-label" class="ecl-form-label">Label<span class="ecl-form-label__required" role="note" aria-label="required">*</span></div> <div class="ecl-help-block" id="example-input-id-1-helper">Only <strong>txt doc docx pdf odt rtf</strong> files. Maximum size is <strong>5 MB</strong>.<br />Encrypted documents and those containing macros are not accepted.</div> <input type="file" class="ecl-file-upload" data-ecl-file-upload-input data-ecl-auto-init="FileUpload" id="example-input-id-1" name="file-upload-name" required aria-describedby="example-input-id-1-label example-input-id-1-helper" /><label class="ecl-file-upload__button-container" for="example-input-id-1"><span class="ecl-file-upload__button ecl-button ecl-button--primary" data-ecl-file-upload-button data-ecl-file-upload-label-choose="Choose file" data-ecl-file-upload-label-replace="Replace file">Choose file</span></label> <ul class="ecl-file-upload__list" data-ecl-file-upload-list></ul> </div>
Try it yourself on the playground
PlaygroundMultiple uploads
<div class="ecl-form-group" data-ecl-file-upload-group="true" data-ecl-autoinit="FileUpload"> <div for="example-file-upload-multiple" id="example-file-upload-multiple-label" class="ecl-form-label">Label<span class="ecl-form-label__required" role="note" aria-label="required">*</span></div> <div class="ecl-help-block" id="example-file-upload-multiple-helper">Only <strong>txt doc docx pdf odt rtf</strong> files. Maximum size is <strong>5 MB</strong>.<br>Encrypted documents and those containing macros are not accepted. </div><input type="file" class="ecl-file-upload" data-ecl-file-upload-input data-ecl-auto-init="FileUpload" id="example-file-upload-multiple" name="file-upload-name" required multiple aria-describedby="example-file-upload-multiple-label example-file-upload-multiple-helper" /><label class="ecl-file-upload__button-container" for="example-file-upload-multiple"><span class="ecl-file-upload__button ecl-button ecl-button--primary" data-ecl-file-upload-button data-ecl-file-upload-label-choose="Choose files" data-ecl-file-upload-label-replace="Replace files">Choose files</span></label> <ul class="ecl-file-upload__list" data-ecl-file-upload-list></ul> </div>
Try it yourself on the playground
PlaygroundDisabled
<div class="ecl-form-group" data-ecl-file-upload-group="true" data-ecl-autoinit="FileUpload"> <div for="example-input-id-1" id="example-input-id-1-label" class="ecl-form-label ecl-form-label--disabled">Label<span class="ecl-form-label__optional" role="note" aria-label="optional">(optional)</span></div> <div class="ecl-help-block ecl-help-block--disabled" id="example-input-id-1-helper">Only <strong>txt doc docx pdf odt rtf</strong> files. Maximum size is <strong>5 MB</strong>.<br />Encrypted documents and those containing macros are not accepted.</div><input type="file" class="ecl-file-upload" data-ecl-file-upload-input data-ecl-auto-init="FileUpload" id="example-input-id-1" name="file-upload-name" required disabled aria-describedby="example-input-id-1-label example-input-id-1-helper" /><label class="ecl-file-upload__button-container" for="example-input-id-1"><span class="ecl-file-upload__button ecl-button ecl-button--primary" data-ecl-file-upload-button data-ecl-file-upload-label-choose="Choose file" data-ecl-file-upload-label-replace="Replace file" disabled>Choose file</span></label> <ul class="ecl-file-upload__list" data-ecl-file-upload-list></ul> </div>
Try it yourself on the playground
PlaygroundWith error
<div class="ecl-form-group" data-ecl-file-upload-group="true" data-ecl-autoinit="FileUpload"> <div for="example-input-id-1" id="example-input-id-1-label" class="ecl-form-label ecl-form-label--invalid">Label<span class="ecl-form-label__required" role="note" aria-label="required">*</span></div> <div class="ecl-help-block" id="example-input-id-1-helper">Only <strong>txt doc docx pdf odt rtf</strong> files. Maximum size is <strong>5 MB</strong>.<br />Encrypted documents and those containing macros are not accepted.</div> <input type="file" class="ecl-file-upload ecl-file-upload--invalid" data-ecl-file-upload-input data-ecl-auto-init="FileUpload" id="example-input-id-1" name="file-upload-name" required aria-describedby="example-input-id-1-label example-input-id-1-helper example-input-id-1-invalid" aria-invalid="true" /><label class="ecl-file-upload__button-container" for="example-input-id-1"><span class="ecl-file-upload__button ecl-button ecl-button--primary" data-ecl-file-upload-button data-ecl-file-upload-label-choose="Choose file" data-ecl-file-upload-label-replace="Replace file">Choose file</span></label> <ul class="ecl-file-upload__list" data-ecl-file-upload-list></ul> <div class="ecl-feedback-message" id="example-input-id-1-invalid"><svg class="ecl-icon ecl-icon--m ecl-feedback-message__icon" focusable="false" aria-hidden="false" role="img"> <title>Error</title> <use xlink:href="/icons.svg#error"></use> </svg>This is the error message</div> </div>
Try it yourself on the playground
PlaygroundOptional
<div class="ecl-form-group" data-ecl-file-upload-group="true" data-ecl-autoinit="FileUpload"> <div for="example-input-id-1" id="example-input-id-1-label" class="ecl-form-label">Label<span class="ecl-form-label__optional" role="note" aria-label="optional">(optional)</span></div> <div class="ecl-help-block" id="example-input-id-1-helper">Only <strong>txt doc docx pdf odt rtf</strong> files. Maximum size is <strong>5 MB</strong>.<br />Encrypted documents and those containing macros are not accepted.</div> <input type="file" class="ecl-file-upload" data-ecl-file-upload-input data-ecl-auto-init="FileUpload" id="example-input-id-1" name="file-upload-name" required aria-describedby="example-input-id-1-label example-input-id-1-helper" /><label class="ecl-file-upload__button-container" for="example-input-id-1"><span class="ecl-file-upload__button ecl-button ecl-button--primary" data-ecl-file-upload-button data-ecl-file-upload-label-choose="Choose file" data-ecl-file-upload-label-replace="Replace file">Choose file</span></label> <ul class="ecl-file-upload__list" data-ecl-file-upload-list></ul> </div>
Try it yourself on the playground
Playground