Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use the file upload control to enable file attachments to forms.  A form may be used to capture data related to another document, like a PDF or image file (JPG, GIF, TIFF).  If for example, users are capturing photos related to an insurance claim, the form may capture relevant details like Date and Claim number.  A File component can be included on the form for users to attach the photos related to the claim.  Files attached to a form may be accessible by the user of the form once uploaded , and may be released as additional pages of a document.

Only image files may be included as additional pages of a document when processed by GlobalCapture.  While uploaded files are always saved as part of the submission regardless of their format, GlobalCapture can only merge uploaded files that are image-based.  Administrators can control the types of files uploaded to a form using the File Pattern setting. Specify the allowed file types with a comma-separated list (do not include any spaces in the list). The image file types that will be included as additional pages when processed by GlobalCapture are: 

Code Block
.pdf,.tif,.tiff,.jpg,.jpeg,.pcx,.png,.bmp,.gif,.doc,.docx,.rtf,.xls,.xlsx,.txt,.csv

Additionally you can restrict the types of files uploaded via this Component by using the "!" symbol. Wildcard characters are also accepted: "*" will allow any extension to be uploaded. To allow all documents except for zip files you would update the File Pattern to be:

Code Block
 *,!.zip

Please note: having extra spaces in the file pattern can cause issues with parsing the file types



By dragging a file component to a form and clicking Save on the settings panel, your form is ready to receive files.  GlobalForms is configured out of the box to accept uploads from the file component.  Administrators may wish to set minimum and maximum sizes for files attached to forms.  Size settings are found on the Display tab of the settings panel.

Note
titleUpload Url
  • Using forms created prior to GlobalForms 10.2, if an administrator attempts to import a form, the Upload Url setting will need to be adjusted to reflect the correct GlobalForms instance.  As of version 10.2, the Upload Url is relative, and should always be "/api/files". Importing a form with a File Component that has a relative url URL will automatically work with the target server's upload location. 

  • You can not alter the Upload Url's relative path. If you deploy forms and modify the GlobalForms configuration at a later date (new port, changing from http HTTP to httpsHTTPS, or you change the GlobalForms server's IP address or name), you may need to modify the Upload Url for all forms that use a File Component. This should only be required if your forms use the absolute url URL syntax of 10.1 and prior.

...

Info
titleIE11 Compatibility

Internet Explorer 11 users will notice an incompatibility when attempting to click the link of a file uploaded. Files will upload correctly, they are just not accessible from the form to the user. To work around this issue, a script can be added to the File Upload Component that fixes the link.

In the component's settings, click the Conditional tab. In the Advanced section, add the following JavaScript.

Code Block
languagejs
titleIE11 File Upload Script
linenumberstrue
if(data[component.key] && data[component.key].length > 0)
{
    for(i=0;i<data[component.key].length;i++)
    {
        var badIndex = data[component.key][i].url.indexOf('undefined');
        if(badIndex > -1)
        {
            var file = data[component.key][i].url.substring(badIndex+9, data[component.key][i].url.length);
            data[component.key][i].url = Formio.getBaseUrl() + '/api/files' + file;
            value = data[component.key][i].url;
        }
    }
}
show = true;


Multiple attachments.

Under the display tab of the file component check the multiple values check box.

Image Added