FileManagerAccessControlAllowedFileTypes Property

Gets or sets the file patterns that are allowed. If not set, any file type is allowed ("*").

This property restricts all actions (List, Delete, Rename, Copy, Move, Extract, Compress, Download and Upload). This means only allowed file types will be visible and manageable in the file list.

DeniedFileTypes take precedence over AllowedFileTypes. For instance, when AllowedFileTypes is set to "*.jpg|*.gif" and DeniedFileTypes is set to "*.gif", only "*.jpg" will be allowed.

When combining patterns in string representation, they should be separated by vertical bar (|).

In a pattern, you can use these wildcards:

  • * matches zero or more characters.
  • ? matches exactly one character.

Some pattern examples:

  • *.* matches files with any extension (does not match files without an extension)
  • *.jpg matches files only with jpg extension
  • picture*.jpg matches files only with jpg extension and which names start with 'picture'
  • picture.* matches files with any extension and which names start with 'picture'
  • picture matches files with no extension and which names are exactly 'picture'
  • *.jp* matches files like 'picture.jpg', 'otherpicture.jpe', 'somepicture.jpeg' etc.
  • *.jp? matches files like 'picture.jpg', 'otherpicture.jpe' etc.
  • picture?.jpg matches files like 'picture1.jpg', 'picture2.jpg', 'pictures.jpg' etc.


Namespace: GleamTech.FileUltimate.AspNet.UI
Assembly: GleamTech.FileUltimate (in GleamTech.FileUltimate.dll) Version: 8.8.8
public FileTypeSet AllowedFileTypes { get; set; }

Property Value



Setting access control file types in code:

//allow only *.jpg and *.gif
accessControl.AllowedFileTypes = "*.jpg|*.gif";
accessControl.AllowedFileTypes = FileTypeSet.Parse("*.jpg|*.gif");
accessControl.AllowedFileTypes = new FileTypeSet

//allow all except *.exe and *.dll
accessControl.DeniedFileTypes = "*.exe|*.dll";
accessControl.DeniedFileTypes = FileTypeSet.Parse("*.exe|*.dll");
accessControl.DeniedFileTypes = new FileTypeSet

Setting access control file types in ASPX markup:

<%-- allow only *.jpg and *.gif --%>
    AllowedFileTypes="*.jpg|*.gif" /> 

<%-- allow all except *.exe and *.dll --%>
    DeniedFileTypes="*.exe|*.dll" />

See Also