Get started

Get the tools and building blocks to design and develop consistent and accessible experiences.

Start developing Start designing

File upload

File uploads allow users to upload documents and images.

Guidance

A file upload field is a type of input element that allows users to select files from their device and upload them. It is often used in forms to enable users to submit documents and images. You should only ask users to upload something if it’s critical to the delivery of your service.

Do

  • Use the accept attribute on your input to specify accepted file types in your HTML.
  • Tell users what file types accepted and the maximum file size.

Don’t

  • Use this component without implementing validation.

Single file upload

This field will launch the Browse files dialog.

You can upload PNG, JPG, JPEG or PDF files.

HTML

<!-- Basic file upload field -->
<label for="file">File</label>
<input type="file" id="file" accept="image/*, .pdf">

Multiple file upload

This component provides the option to drag and drop or browse and select multiple files to upload.

Drag and drop file upload

Click to upload or drag and drop PNG, JPG, JPEG or PDF files (max 15MB).

HTML

<!-- Drag and drop file upload -->
<fieldset class="fieldset-container-dashed file-upload centered">
<legend class="sr-only">Drag and drop file upload</legend>
<i class="fa-solid fa-file-arrow-up"></i>
<p>
<a href="#">Click to upload</a> or drag and drop PNG, JPG, JPEG or PDF files (max 15MB).
</p>
</fieldset>