File Type Upload Control 


In this Article
Related Articles

Introduction

If you are asking your users to upload a file to your form, it is now possible to control what types of files can be accepted. For example, if you only wanted to accept image files for a particular upload field, you now have that option.

This can be helpful in preventing users from uploading the wrong types of files, thus saving you the trouble of having to ask your users to resubmit files they incorrectly uploaded.


File Type Validation

Once you are inside the form builder, you will need to Add an Upload Field, click on Options and then select Validation Rules.

From here, there are three "quick" options for you to choose from: image files, documents (office files), and archive files. These represent the most common types of files. However, you can also define custom file extensions if needed.

Please note:  The language of the File Upload text (not the label) is controlled by the language of the browser.  


Images Quick Option

The Images Option covers the following image types:

  • .bmp
  • .gif
  • .jpg
  • .jpeg
  • .png
  • .tif
  • .qtf



Office Files Quick Option

The Documents Option covers the following file types:

  • .doc
  • .docx
  • .xls
  • .xlsx
  • .ppt
  • .pptx
  • pages
  • .keynote
  • .key
  • .numbers
  • .pdf
  • .odt
  • .odt
  • .ods
  • .odp

Archive Files Quick Option

The Archive Files Option encompasses the following file types:

  • .zip
  • .rar
  • .tar
  • .gz
  • .shar
  • .cpio
  • .bz2
  • .lz
  • .lzma
  • .lzo
  • .sz
  • .xz
  • .z
  • .Z
  • .7x
  • .ace
  • .afa
  • .alx
  • .aok
  • .ark
  • .b1
  • .cab
  • .cfs
  • .dar
  • .dgc
  • .dmb
  • .gca
  • .lzh
  • .lha
  • .lzx
  • .sit
  • .sitx
  • .tgz
  • .tbz2
  • .tlz
  • .zoo
  • .par
  • .par2

Custom File Extensions

If you are expecting users to upload file types that are not included in the above options, you can click the Custom File Extension checkbox in order to allow for other options.

Once you check the Custom File Extension box, a blank text field will appear:

You can enter into the text field the extension of the file you are expecting. You do not need to include the period before the extension. You may enter multiple extensions by separating them with commas. When doing so, do not put in spaces.

Here is an example using common extensions: doc,docx,pdf,png,zip

Once you have entered in your custom values, save your form to apply your changes. 


Upload Processing

When a respondent submits a response with a file upload, the FormAssembly server will check that the file's extension corresponds with the list of extensions you have specified. If there is a mismatch, the server will return an error to the user.

If the file extension is in the list of allowed extensions, the server will go on to check the internal type (known as the MIME type) of the file. This acts as an integrity check to ensure the internal type of the file corresponds to what the file extension says it is. If there is a mismatch between these two, the file is still let through, but the mismatch is logged by the server. If there is a match between the two, then the file is fine and is let through without incident.

Terms of Service · Privacy Policy