enclosuresettingsAdded by IBM on August 8, 2013 | Version 1 (Original)
|Sets limits on the size and type of files that users can attach to a form.
Table 1. enclosuresettings parameters
|maxsize||integer||The maximum size in kilobytes of any one attachment in a form. The file size of each attachment must be less than or equal to this value. If -1 or if not present, there is no limit on maximum size. |
|totalsize||integer||The maximum size in kilobytes of all attachments in a form. The sum of the file sizes of all attachments in a form must be less than or equal to this value. If -1 or if not present, there is no limit on maximum size.|
|mediatype||string||A whitespace-delimited list of file types that can be attached to a form. The list can be MIME types, file name extensions, or a combination. You can use * as a wildcard in the MIME subtype. For example: text/* application/pdf .png .gif .jpg .jpeg The file extensions must begin with the . character, and are not case sensitive. That is, .jpg includes .JPG and all other combinations of case. If not present, all file types are allowed.|
|name||string||If set to true, all attachments in a form must have unique file names. File name comparisons are case sensitive. If false or if not present, duplicate file names are allowed.|
button of type enclose, cell of type enclose, page global, form global
The following example shows an enclosuresettings option that limits the size of each individual attachment to a maximum of 1 megabyte with an overall limit of 10 megabytes. Any number of files can be attached as long as the sum of their file sizes is less than 10 megabytes. Also, only PDF and plain text files can be attached.
- This setting does not apply to enclosures made using xforms:upload.
- Default: If the enclosuresettings option is not present, no limits are enforced.
- The uniquename setting affects only form global. It is ignored in the button item, cell item, and page global.
- When enclosing a file in an xfdl:data element that is not part of a data group, the xfdl:data element may already contain a file. In this case the file will be replaced by the file currently being added, therefore, the name of the file being replaced will not be considered when checking for a distinct name.
- When enclosing a file in an xfdl:data element that is part of a data group, the data group may already contain an xfdl:data element with the same file name. In this case the matching file will be replaced by the file currently being added. As a result, the name of the file being replaced will not be considered when checking for a distinct name.
- A file must pass all in-scope enclosuresettings constraints before it can be attached. For example, if a button enclosuresettings limits the file size to 1024 kilobytes, and the form global enclosuresettings limits file size to 512 kilobytes, then the maximum size of any one file that can be attached to the form is 512 kilobytes.