Extension

This element holds the extension details of the file that the user uploads.

Possible Locations

Attributes


Name Type Description
name
required
String (CSV) Name of the file extension. For example txt, png, jpg.
size String (CSV) The minimum and maximum possible size of each file in bytes like size="0,100".
You can also opt to configure only the maximum size.
length String (CSV) The number of files that can be uploaded in the particular extension. The minimum and maximum counts of the file
can be provided like length="1,3". You can also opt to configure only the maximum count.

Example

Let us say that we want to configure a few validations based on extensions for a file <property> in the destination resource. The requirements are as follows,

    
copy
png: 3 files each with size 500 to 1000 bytes xml: 2 files each with size 1000 to 1500 bytes

Use the above details and write the extension as shown here.

    
copy
<property name="tourist_spots" type="file" length="5"> <file-meta overall-size="6000" import-url="false" continue-on-error="true"> <extension name="png" size="500,1000" length="3"/> <extension name="jpg" length="2"/> </file-meta> </property>

Last Updated 2025-05-30 16:54:59 +0530 +0530