# File upload

## Overview

Use this widget to give the user the possibility to upload one or more file attachments to the form.

After you have added the *File upload* form widget in your form and opened its settings, the *File upload* window appears, displaying the following sections:

## Labels and content

In this section, perform the following:

1. In *Label* input field enter the label of the upload box.\
   For example, `Attach a file`
2. Optionally, in *Instructional text*, enter instructions or explanatory text for the upload box.\
   The text is displayed bellow the upload box.
3. If you want the user to be able to attach more than one file, select *Upload multiple files* checkbox.
4. If you want to make the file upload mandatory, select the *Required field* checkbox\
   A textbox appears, where you enter the error message that is displayed, if the user does not upload anything.
5. If you want this field to be visible in the form only when certain conditions are met, select *Hide field initially* checkbox.\
   You can then use form ruled to display the field. For more information, see [Form rules](https://www.progress.com/documentation/sitefinity-cms/form-rules).

## Limitations

In this section, perform the following:

1. In *Min* and *Max* input fields, enter in MB the range of the file size that you are going to accept as attachments.
2. Enter the error message that will appear, if the attached file does not match the specified size.
3. Under *File types*, select one of the following:
   * *All file types*
   * *Selected file types*\
     A checkbox group appears where you can limit the types of files that you accept as attachments.
   * You can also enter the file extension manually, by selecting *Other*.
4. Enter the error message that will appear, if the attached file does not match the specified types.

## Display settings

In this section, you can select a template other than the default one that will be used to display the *File upload* widget on the website.

You must first have created a custom template.\
For more information, see [Next.js pages and templates](https://www.progress.com/documentation/sitefinity-cms/next.js-pages-and-templates).

Save your changes.

## Advanced widget settings

To open the advanced settings, in the upper-right corner of the File upload widget page, click ![DotNetCore11](https://www.progress.com/documentation/sitefinity-cms/assets/0b5bf6d61861bf099d7f849dde3e94ea/settings-dotnetcore.jpg "DotNetCore11") (*Advanced settings*).

1. In *CSS class* input field, you can choose a class name for the upload box, if later you want to set a CSS style for this particular upload box.
2. You can change the automatically generated name for developers of this upoad box field by and entering the new name in the input field that appears.\
   This is the name of the field that is used by developers to refer to this upload box field in the code.
3. Save your changes.

## Storage

File attachments are stored in a dedicated library in *User files*. For each form there is a different library. The libraries are automatically created when the first file is uploaded and attached.

To manage the files in a form library, in the main navigation click *Administration* » *User files* and select the library of the form.

## Permissions

If you want a user to be able to see the library with form attachments, you must grant explicit permissions to this user to work with the form’s library. It is not enough when the user to have permissions to manage forms.
