Back to Devexpress

FileSystemErrorCode Enum

aspnetcore-devextreme-dot-aspnet-dot-mvc-dot-filemanagement-91d81469.md

latest1.8 KB
Original Source

FileSystemErrorCode Enum

Lists error codes.

Namespace : DevExtreme.AspNet.Mvc.FileManagement

Assembly : DevExtreme.AspNet.Core.dll

Declaration

csharp
public enum FileSystemErrorCode

Members

NameDescription
NoAccess

The file or directory has no access.

| | FileExists |

The file already exists.

| | FileNotFound |

The file is not found.

| | DirectoryExists |

The directory already exists.

| | DirectoryNotFound |

The directory is not found.

| | WrongFileExtension |

The file has a wrong extension.

| | MaxFileSizeExceeded |

The file size exceeds the maximum file size limit.

| | InvalidSymbols |

The file or directory name contains one or more invalid symbols.

| | Unspecified |

Unspecified error.

|

The following properties accept/return FileSystemErrorCode values:

Remarks

The following error codes are available:

js
NoAccess = 0,
FileExists = 1,
FileNotFound = 2,
DirectoryExists = 3,
DirectoryNotFound = 4,
WrongFileExtension = 5,
MaxFileSizeExceeded = 6,
Other = 32767

The example below illustrates how to generate an exception if a file has no access.

csharp
void ThrowNoAccessException() {
    string message = "Access denied. The operation cannot be completed.";
    throw new FileSystemException(FileSystemErrorCode.NoAccess, message);
}

Online Demo

See Also

DevExtreme.AspNet.Mvc.FileManagement Namespace