Skip to content

Restrict the number of files that can be uploaded

The File component can upload several files directly to SharePoint. You can limit how many files a responder may include by allowing only one file per component or by adding a custom validation rule.

  1. Use several File components that each allow one upload.

  2. Use one multiple-value File component with a maximum-count validation rule.

Disable Multiple Values on a File component when each field should accept only one file. Add as many separate File components as the form requires.

  1. Drag and drop a file component into your form

  2. Under the Data tab disable the “Multiple Values” option and save

  3. Repeat this until the number of File components matches the maximum number of permitted files.

A single multiple-value File component is often more compact. Add a custom validation rule to prevent submission when it contains too many files.

  1. Drag a File component into the form and enable Multiple Values.

  2. In the Validation tab, expand Custom Validation.

  3. To permit up to three files, enter:

valid = instance.getValue().length <= 3

For a different limit, replace 3 with the required maximum. A failed rule prevents submission until enough files are removed.