Sets limits on the size and type of files that users can attach to a form.
<enclosuresettings>
<maxsize>maxsize</maxsize>
<totalsize>totalsize<totalsize>
<mediatypes>mediatype<mediatypes>
<uniquenames>name<uniquenames>
</enclosuresettings>
Parameter | Type | Description |
---|---|---|
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.
<button sid="enclose_button">
<value>Enclose File</value>
<fontinfo>
<fontname>Helvetica</fontname>
<size>18</size>
<effect>bold</effect>
<effect>italic</effect>
</fontinfo>
<type>enclose</type>
<enclosuresettings>
<maxsize>1024</maxsize>
<totalsize>10240<totalsize>
<mediatypes>.pdf text/*<mediatypes>
</enclosuresettings>
</button>