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.

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 ASP.NET Core 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 (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.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Content block