Config2_FileNameFilterManager

Sometimes it is a requirement to block the upload of certain file types, such as executable files. This class allows you to specify the filters used to control what files can be uploaded. Note that the filters are also applied to renaming of files - otherwise a user could upload a file with an acceptable name and then rename it to a banned name. Administrators can choose to block files that match the filters, or to only permit files that match the filters.

Instances of this class are obtained from:

Properties

PropertyTypeDescription
matchingFilesBlocked Boolean

If true (which is the default), then files that match the filters will be blocked.

Methods

MethodReturnsDescription
add() void

Add a filter pattern (e.

get() String

Get a filter pattern by index.

remove() void

Remove a filter by index.

toArray() Array.<String>

Get all filter patterns as an array of strings.

Property Details

matchingFilesBlocked :Boolean

Description:
  • If true (which is the default), then files that match the filters will be blocked. Otherwise, only files that match the filters will be permitted.

If true (which is the default), then files that match the filters will be blocked. Otherwise, only files that match the filters will be permitted.

Type:
  • Boolean

Method Details

add(filter)

Description:
  • Add a filter pattern (e.g. ".exe", ".bat").

Parameters:
Name Type Description
filter String

Filter pattern using wildcards.

get(index) → {String}

Description:
  • Get a filter pattern by index.

Parameters:
Name Type Description
index Number

Filter index (0-based).

Returns:

Filter pattern.

Type
String

remove(index)

Description:
  • Remove a filter by index.

Parameters:
Name Type Description
index Number

Filter index (0-based).

toArray() → {Array.<String>}

Description:
  • Get all filter patterns as an array of strings.

Returns:

Array of filter patterns (e.g. [".exe", ".bat"]).

Type
Array.<String>