Class MediaType.FileValidation
Used to determine whether the MediaFile is respecting the EMS's rulesets for this MediaType.
Inheritance
System.Object
MediaType.FileValidation
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Appearition.SDK.dll
[Serializable]
public class FileValidation
Constructors
View Source
Declaration
View Source
Declaration
public FileValidation(MediaType.FileValidation cc)
Parameters
Fields
View Source
Declaration
public bool AllowFileNameWhitespace
Field Value
Type |
Description |
System.Boolean |
|
View Source
Declaration
public bool AllowSameNamedFile
Field Value
Type |
Description |
System.Boolean |
|
View Source
Declaration
public bool CheckForInvalidFileNameChars
Field Value
Type |
Description |
System.Boolean |
|
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
public string InvalidFileNameCharsCsv
Field Value
Type |
Description |
System.String |
|
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
public string MediaTypeName
Field Value
Type |
Description |
System.String |
|
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
View Source
Declaration
Field Value
Type |
Description |
System.String |
|
View Source
Declaration
public string PlatformType
Field Value
Type |
Description |
System.String |
|
View Source
Declaration
public string ValidFileMimeTypeCsv
Field Value
Type |
Description |
System.String |
|
View Source
Declaration
public string ValidFileNameExtensionCsv
Field Value
Type |
Description |
System.String |
|
View Source
Declaration
public long ValidFileSizeInBytes
Field Value
Type |
Description |
System.Int64 |
|
View Source
Declaration
public long ValidFileSizeInKBytes
Field Value
Type |
Description |
System.Int64 |
|
View Source
Declaration
public long ValidFileSizeInMBytes
Field Value
Type |
Description |
System.Int64 |
|
Methods
View Source
Returns whether or not this File Validation contains the given extension as a rule.
Declaration
public bool ContainsExtension(string extension)
Parameters
Type |
Name |
Description |
System.String |
extension |
Extension.
|
Returns
Type |
Description |
System.Boolean |
true , if extension was containsed, false otherwise.
|
View Source
Returns all the invalid characters a filename cannot have, as a char array.
Declaration
public char[] GetAllInvalidCharacters()
Returns
Type |
Description |
System.Char[] |
|
View Source
Returns a list of all the file extensions allowed for this file validation.
Declaration
public string[] GetFileExtensions(bool includeDot = true, bool includeStar = false)
Parameters
Type |
Name |
Description |
System.Boolean |
includeDot |
eg .mp4
|
System.Boolean |
includeStar |
eg *.mp4
|
Returns
Type |
Description |
System.String[] |
The file extensions.
|
View Source
From a given extension, finds and fetches a mimetype.
Declaration
public string GetMimeTypeForExtension(string extension)
Parameters
Type |
Name |
Description |
System.String |
extension |
Extension.
|
Returns
Type |
Description |
System.String |
The MIME type for extension.
|
View Source
Returns a container with all available mimetypes for this file validation.
Declaration
public string[] GetMimeTypes()
Returns
Type |
Description |
System.String[] |
The MIME types.
|
View Source
Handle the file validation for this specific file validation content.
The MediaType should be having the final word on whether the file is valid or not.
Declaration
public bool IsFileValid(string fileNameWithExtension, int fileSizeInBytes)
Parameters
Type |
Name |
Description |
System.String |
fileNameWithExtension |
File name with extension.
|
System.Int32 |
fileSizeInBytes |
File size in bytes.
|
Returns
Type |
Description |
System.Boolean |
true if this instance is file valid the specified fileNameWithExtension fileSizeInBytes; otherwise, false .
|
Extension Methods