CodeCharge Studio

AllowedFileMasks Run-Time Property (ASP)

Applies to

FileUpload Control

Type

string

Access

read/rite

Syntax

object.AllowedFileMasks [= value]

Description

Specifies a list of file masks (separated with semicolon) that are allowed by the FileUpload component. If a user tries to upload a file with a mask that matches one of the masks specified in this property, the file will be uploaded (unless the mask is also listed in the DisallowedFileMasks property). Otherwise, the upload will fail and an error message will be displayed. The AllowedFileMasks property corresponds to the "Allowed File Masks" Design-Time property of the FileUpload component.

Example

The AfterInitialize event procedure shown below alters the AllowedFileMasks property for logged and not logged in users. Anonymous users are allowed to upload only text files (txt), logged in users may upload any file.
Function Page_AfterInitialize() 

 If CCGetUserID() = Empty Then
  attachments.fu.AllowedFileMasks = "*.txt"
 Else
  attachments.fu.AllowedFileMasks = "*"
 End if

End Function 

See also

DisallowedFileMasks Property


On-line, printable versions and updates