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:
Some pattern examples:
public FileTypeSet AllowedFileTypes { get; set; }
Public Property AllowedFileTypes As FileTypeSet
Get
Set
Setting access control file types in code:
//allow only *.jpg and *.gif
accessControl.AllowedFileTypes = "*.jpg|*.gif";
//or
accessControl.AllowedFileTypes = FileTypeSet.Parse("*.jpg|*.gif");
//or
accessControl.AllowedFileTypes = new FileTypeSet
{
"*.jpg",
"*.gif"
};
//allow all except *.exe and *.dll
accessControl.DeniedFileTypes = "*.exe|*.dll";
//or
accessControl.DeniedFileTypes = FileTypeSet.Parse("*.exe|*.dll");
//or
accessControl.DeniedFileTypes = new FileTypeSet
{
"*.exe",
"*.dll"
};
'allow only *.jpg and *.gif
accessControl.AllowedFileTypes = "*.jpg|*.gif"
'or
accessControl.AllowedFileTypes = FileTypeSet.Parse("*.jpg|*.gif")
'or
accessControl.AllowedFileTypes = New FileTypeSet() From {
"*.jpg",
"*.gif"
}
'allow all except *.exe and *.dll
accessControl.DeniedFileTypes = "*.exe|*.dll"
'or
accessControl.DeniedFileTypes = FileTypeSet.Parse("*.exe|*.dll")
'or
accessControl.DeniedFileTypes = New FileTypeSet() From {
"*.exe",
"*.dll"
}
Setting access control file types in ASPX markup:
<%-- allow only *.jpg and *.gif --%>
<GleamTech:FileManagerAccessControl
Path="\"
AllowedPermissions="Full"
AllowedFileTypes="*.jpg|*.gif" />
<%-- allow all except *.exe and *.dll --%>
<GleamTech:FileManagerAccessControl
Path="\"
AllowedPermissions="Full"
DeniedFileTypes="*.exe|*.dll" />