VMware Cloud Community
WGW1969
Contributor
Contributor

How can I restrict the files a user is allowed to load from a file browser?

Does anyone know how to restrict the allowed files for fileParameter input?

For example, allow the user to choose only files with a .zip extension?

I cannot find anything in the user guide showing if/how this is possible.

Something like:

<fileParameter>
<name>chooseAFile</name>
...
<allowableFileFilter>*.zip</allowableFileFilter>
</fileParameter>

to make sure the user can only load a file with a .zip extension.

Reply
0 Kudos
1 Reply
michieldhont_
Hot Shot
Hot Shot

You can add a <validationActionList> to the parameter:

  <fileParameter>
    <name>chooseAFile</name>
    <validationActionList>
      <throwError>
       <ruleList>
          <compareText text="${chooseAFile}" logic="contains" value=".txt"/>
      </ruleList>
     </throwError>
    </validationActionList>
   </fileParameter>

 

Reply
0 Kudos