CodeCharge Studio

DisallowedFileMasks Run-Time Property (ASP)

Applies to

FileUpload Control

Type

string

Access

read/write

Syntax

object.DisallowedFileMasks [= value]

Description

Specifies a list of file masks (separated by semicolons) that are not allowed by the FileUpload component. File mask item may contain * and ? characters for matching any characters.

If a user provides a file with a name that matches one of the masks specified in this property, the file will not be uploaded and an error message will be displayed. The verification is performed during control validation, before calling the control's On Validate event. The result of the check may be reset during this event.

The DisallowedFileMasks property corresponds to the "Disallowed File Masks" Design-Time property of the FileUpload component.

Note: The DisallowedFileMasks property has higher priority than AllowedFileMasks property. In other words, if a mask is mentioned in both properties (AllowedFileMasks and DisallowedFileMasks) the upload will fail.

Examples

The following example resets disallowed file masks if the user's security level is higher than 1. Otherwise, HTML, ASP and ZIP files are restricted.
If CCGetGroupID() > 1 Then
  Record1.FileUpload1.DisallowedFileMasks = ""
Else
  Record1.FileUpload1.DisallowedFileMasks = "*.html;*.asp;*.zip"
End If

See also

OnValidate event
AllowedFileMasks property


On-line, printable versions and updates