Class UploaderValidateOption
Holds legacy file validation settings such as size, extension, and MIME restrictions.
Inherited Members
Namespace: CuteWebUI
Assembly: AjaxUploader.dll
Syntax
[TypeConverter(typeof(ExpandableObjectConverter))]
public class UploaderValidateOption
Properties
AllowedFileExtensions
Gets or sets the allowed file extensions.
Declaration
public string AllowedFileExtensions { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
AllowedFileMimeTypes
Gets or sets the allowed MIME types.
Declaration
public string AllowedFileMimeTypes { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
AllowedFileRegExp
Gets or sets the regular expression used to validate file names.
Declaration
public string AllowedFileRegExp { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
EnableMimetypeChecking
Gets or sets whether MIME type validation is enabled.
Declaration
public bool EnableMimetypeChecking { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MaxSizeKB
Gets or sets the maximum allowed file size in kilobytes.
Declaration
public int MaxSizeKB { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
GetMaxSizeKBWithConfig()
Returns the effective maximum file size in kilobytes.
Declaration
public int GetMaxSizeKBWithConfig()
Returns
| Type | Description |
|---|---|
| int |
MatchExtension(string)
Tests whether the file name matches the configured extension allow-list.
Declaration
public bool MatchExtension(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename |
Returns
| Type | Description |
|---|---|
| bool |
MatchMimeType(string, string)
Tests whether the supplied MIME type matches the configured allow-list.
Declaration
public bool MatchMimeType(string filename, string filetype)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | |
| string | filetype |
Returns
| Type | Description |
|---|---|
| bool |
MatchRegExp(string)
Tests whether the file name matches the configured regular expression.
Declaration
public bool MatchRegExp(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename |
Returns
| Type | Description |
|---|---|
| bool |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
ValidateFileData(UploaderProvider, Guid)
v4 parity: validates an already-stored file against this option set, throwing when it fails. v4 called this from custom providers after a file landed on disk; v5 validates on every chunk, at completion, and against the real assembled size, so this re-checks the stored metadata and stays useful for code that calls it explicitly.
Declaration
public void ValidateFileData(UploaderProvider provider, Guid fileguid)
Parameters
| Type | Name | Description |
|---|---|---|
| UploaderProvider | provider | The provider holding the file. |
| Guid | fileguid | Identifier of the stored file. |