File Upload Question Type

Last Updated: 30 May 2016

The File Upload question
The File Upload question type

The File Upload question type allows the user to upload a file to the form. This file is stored as an asset within your system.

Bookmarks to the headings on this page:

  1. Details Screen

Details Screen

The Details screen allows you to configure the settings of the File Upload question.

Question Options

This section allows you to customise the options for the File Upload question. The Question Options section is shown in the figure below:

The File Upload Question Options
The Question Options section

The following fields are available:

  • The File Upload Question asset
    The question asset

    Title: enter the question title, for example Upload CV. When you change the Title of the question, the asset name will change in the Asset Map, as shown in the figure to the right. This Title will appear on the Custom Form as the name of the question.
  • Note: enter a note to be displayed for the question on the Custom Form. This can be used to provide information to your users about the question and the expected form of the response. For example Please upload your CV.
  • Create Location: each file that is uploaded via this question type is stored as an asset within the system. This field allows you to select where in your system you want these assets stored. For example, you could create a Folder under the Custom Form and store the files in there. If no Create Location has been set, uploaded files will be stored in the data directory of the Form Submission. Uploaded files can be downloaded to your computer on the Details screen of a submission, as shown in the figure below. This screen can be accessed through the Submission Logs screen.

    The Download File option for a Submission
    The Click to download button on the Details screen of a Submission

  • Tab Index: enter the tab index for the File Upload question on the Custom Form. This is index is used when the user press the Tab key on the keyboard. This is useful when you have laid out each question individually on the Page Contents Bodycopy. If this question is the first question on the Custom Form, but on the Page Contents Bodycopy you have put it last, you can enter the Tab Index so that when the user presses the Tab key, it will be the last question the cursor goes to.
  • Extras: enter any additional HTML attributes to be added to the tag used to display the answer field for the question. For example, you may wish to specify a CSS class that defines the formatting of the question text.
  • Attach to Emails: select Yes to attach the file that is uploaded to the emails that have Include File Attachments selected on the Email Options screen of the Form Contents asset. For more information on the Email Options screen, refer to the Form Contents chapter in this manual.
Simple Validation Rules

The Simple Validation Rules section of the Details screen is shown in the figure below.

The Simple Validation Rules section for a File Upload question
The Simple Validation Rules section

The first part of this section allows you to select whether or not this question is mandatory. For more information on the Required Entry and Custom Required Error fields, refer to the Questions chapter in this manual.

The Overwrite Rule field allows you to select the action to be taken if a file of the same name already exists in the upload location you have specified. If no Create Location is specified, the Overwrite Rule is disabled. The options that are available are as follows:

  • Raise a Submission Error: when the user tries to submit the form, show them an error notifying them that the file already exists. The error message will be similar to There was an error uploading the file for File Upload question "Upload CV" - file already exists in path.
  • Rename Uploaded File: automatically rename the file being uploaded by appending a number to the filename. For example, if you try to upload the file test.doc, which already exists, it will automatically be renamed to test2.doc.
  • Overwrite Existing File: overwrite the existing file with the new file being uploaded.
  • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
Complex Validation Rules

The Complex Validation Rules section of the Details screen allows you to add additional validation rules to the select question. For more information on how to add a rule, refer to the Questions chapter in this manual.

Please note that these custom complex rules will overwrite any existing global file validation rules than have been configured on your system. By default, the system-wide file preferences will be enforced, as configured in the Global Preferences settings.

The complex validation rules that are available for the File Upload question are as follows:

  • Uploaded File Size: this rule allows you to limit the size of the file that can be uploaded by the user. For example, if you do not want the user to upload a file bigger than 1MB, select Must be no larger than in the Operator field and enter 1 MB in the File Size field. When the user tries to submit a file larger than 1MB they will receive an error message.    

    The fields that can be set up are as follows:
    • Operator: select from Must be no larger than or Must be no smallerthan. If you select Must be no larger and enter a value that is greater than the PHP configuration setting, the PHP configuration setting will override it. For example, if the PHP configuration says 2 MB and you enter 10 MB, 2 MB will be used instead of 10 MB.
    • File Size: specify the size of the file. For example, if the user cannot upload a file bigger than 1MB, enter 1 into the first field and select MB from the second field. The units that are available include bytes, KB, MB, or GB.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show if the rule fails. If you do not enter an error message, a default message will appear similar to File uploaded at question "Upload CV" must be no larger than 1 MB.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Uploaded File Type: this rule allows you to limit the type of the file that can be uploaded by the user. For example, if you only want to allow them to upload MS Word Documents, select Must match one of these extensions in the Operator field and enter .doc in the Extension List. When the user tries to submit a file that is not a MS Word Document they will receive an error message.

    The fields that can be set up are as follows:
    • Operator: select from Must match one of these extensions or Must not match one of these extensions.
    • Extension List: this section shows the extensions you have added, allows you to add new ones and delete existing ones. To add an extension to the list, click within a blank box, enter the extension – for example .doc or doc - and click Commit. You can add as many extensions as you want at the same time and there is no limit to the number of options you can add to the list. To delete a particular extension from the list, click on the Delete Icon icon to the right of the box.
    • Enforce MIME Check: select whether or not to use the MIME type check on uploaded files. If this field is selected, uploaded files will be checked to ensure that the file data matches that expected by the file extension. For example, an uploaded image file could be checked to verify that it is an image and not just a file with an image type extension. By default, this field is selected.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show if the rule fails. If you do not enter an error message, a default message will appear similar to Name of uploaded file "logo.gif" at question "Upload CV" is invalid – extension must match one of the follow: .doc.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.
  • Uploaded File Virus Check: this rule allows you to prevent files from being uploaded should the Virus Checker detect a virus. For example, if a user uploads a file containing a virus, the Virus Checker will detect that the file is infected and not allow it to be uploaded to the system.

    The fields that can be set up are as follows:
    • Enable Virus Checking: select this field to enable virus checking for uploaded files. In order to use this field, a Virus Checker must be configured for this system. If no Virus Checker is configured, an error message will appear as shown in the figure above. For more information on configuring the Virus Checker, refer to the External Tools chapter of the System Configuration manual.
    • Custom Progress Indicator Text: enter a customised message to indicate to a user that their uploaded file is in the progress of being checked for viruses. If you do not enter a progress indicator message, a default message will appear.
    • Custom Progress Indicator Class: enter a customised CSS class to define the format of the progress indicator. If you do not enter a CSS class, the default format will appear.
    • Condition: this field allows you to add a condition on the validation rule. For more information, refer to the Questions chapter in this manual.
    • Custom Error Text: enter a customised error message to show if the rule fails. If you do not enter an error message, a default message will appear.
    • Delete?: to delete this validation rule, click the Delete check box and click Commit.

Please note that the progress indicator can only be displayed and customised when the Client-Side Validation field is set to On.