File

Angular Bootstrap 5 File

File Input is a field which the user can use to upload one or more files (photos, documents or any other file type) from local storage.


Basic example

The file input is the most gnarly of the bunch and requires additional JavaScript if you’d like to hook them up with functional Choose file… and selected file name text.

        
            
            <label class="form-label" for="customFile">Default file input example</label>
            <input type="file" class="form-control" id="customFile" />
          
        
    

Add the disabled attribute to the <input> and the custom markup will be updated to appear disabled.

        
            
            <label for="formFileDisabled" class="form-label">Disabled file input example</label>
            <input class="form-control" type="file" id="formFileDisabled" disabled />
          
        
    

Sizing

You may also choose from small and large file inputs to match our similarly sized text inputs.

        
            
            <label for="formFileSm" class="form-label">Small file input example</label>
            <input class="form-control form-control-sm" id="formFileSm" type="file" />
            <label for="formFileLg" class="form-label">Large file input example</label>
            <input class="form-control form-control-lg" id="formFileLg" type="file" />