C# Класс Serenity.Web.UploadHelper

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CheckFileNameSecurity ( string fileName ) : void
CopyFileAndRelated ( string sourceFilePath, string targetFilePath, bool overwrite = false ) : void
CopyFileAndRelatedToHistory ( string sourceFilePath ) : string
CopyTemporaryFile ( string dbTemporaryFile, object entityId, FilesToDelete filesToDelete, string>.Func fileNameReplacer = null ) : CopyTemporaryFileResult
CopyTemporaryFile ( string dbTemporaryFile, object entityId, string>.Func fileNameReplacer = null ) : CopyTemporaryFileResult
DbFilePath ( string dbFileName ) : string
DeleteFileAndRelated ( string dbFileName, DeleteType deleteType ) : void
FileNameSizeDisplay ( string name, int bytes ) : string
FileSizeDisplay ( int bytes ) : string
FormatDbFileName ( object entityId, string extension ) : string
FormatDbFileName ( string format, object identity, string extension ) : string
GetMimeType ( string fileName ) : string

Gets MIME type for a given file using information in Win32 HKEY_CLASSES_ROOT registry key.

GetThumbFileName ( string fileName, string thumbSuffix = "_t.jpg" ) : string
ImageFileUrl ( string fileName, bool thumbnailUrl ) : string

Gets URL of an image file or its thumbnail under a subfolder of file upload root. If filename starts with "approval?", approval folder is used instead of the specified subfolder name. If file name is empty, then a null image file URL is returned

RegisterFilesToDelete ( IUnitOfWork unitOfWork, FilesToDelete filesToDelete ) : void
ToPath ( string fileName ) : string

Converts forward slashes to backslashes

ToUrl ( string fileName ) : string

Converts backslashes to forward slashes

UploadHelper ( string dbFileFormat ) : Serenity.ComponentModel

Описание методов

CheckFileNameSecurity() публичный статический Метод

public static CheckFileNameSecurity ( string fileName ) : void
fileName string
Результат void

CopyFileAndRelated() публичный статический Метод

public static CopyFileAndRelated ( string sourceFilePath, string targetFilePath, bool overwrite = false ) : void
sourceFilePath string
targetFilePath string
overwrite bool
Результат void

CopyFileAndRelatedToHistory() публичный статический Метод

public static CopyFileAndRelatedToHistory ( string sourceFilePath ) : string
sourceFilePath string
Результат string

CopyTemporaryFile() публичный Метод

public CopyTemporaryFile ( string dbTemporaryFile, object entityId, FilesToDelete filesToDelete, string>.Func fileNameReplacer = null ) : CopyTemporaryFileResult
dbTemporaryFile string
entityId object
filesToDelete FilesToDelete
fileNameReplacer string>.Func
Результат CopyTemporaryFileResult

CopyTemporaryFile() публичный Метод

public CopyTemporaryFile ( string dbTemporaryFile, object entityId, string>.Func fileNameReplacer = null ) : CopyTemporaryFileResult
dbTemporaryFile string
entityId object
fileNameReplacer string>.Func
Результат CopyTemporaryFileResult

DbFilePath() публичный статический Метод

public static DbFilePath ( string dbFileName ) : string
dbFileName string
Результат string

DeleteFileAndRelated() публичный статический Метод

public static DeleteFileAndRelated ( string dbFileName, DeleteType deleteType ) : void
dbFileName string
deleteType DeleteType
Результат void

FileNameSizeDisplay() публичный статический Метод

public static FileNameSizeDisplay ( string name, int bytes ) : string
name string
bytes int
Результат string

FileSizeDisplay() публичный статический Метод

public static FileSizeDisplay ( int bytes ) : string
bytes int
Результат string

FormatDbFileName() публичный Метод

public FormatDbFileName ( object entityId, string extension ) : string
entityId object
extension string
Результат string

FormatDbFileName() публичный статический Метод

public static FormatDbFileName ( string format, object identity, string extension ) : string
format string
identity object
extension string
Результат string

GetMimeType() публичный статический Метод

Gets MIME type for a given file using information in Win32 HKEY_CLASSES_ROOT registry key.
public static GetMimeType ( string fileName ) : string
fileName string /// File name whose MIME type will be determined. Its only extension part will be used.
Результат string

GetThumbFileName() публичный статический Метод

public static GetThumbFileName ( string fileName, string thumbSuffix = "_t.jpg" ) : string
fileName string
thumbSuffix string
Результат string

ImageFileUrl() публичный статический Метод

Gets URL of an image file or its thumbnail under a subfolder of file upload root. If filename starts with "approval?", approval folder is used instead of the specified subfolder name. If file name is empty, then a null image file URL is returned
public static ImageFileUrl ( string fileName, bool thumbnailUrl ) : string
fileName string /// File name.
thumbnailUrl bool /// True to return thumbnail URL.
Результат string

RegisterFilesToDelete() публичный статический Метод

public static RegisterFilesToDelete ( IUnitOfWork unitOfWork, FilesToDelete filesToDelete ) : void
unitOfWork IUnitOfWork
filesToDelete FilesToDelete
Результат void

ToPath() публичный статический Метод

Converts forward slashes to backslashes
public static ToPath ( string fileName ) : string
fileName string /// Filename.
Результат string

ToUrl() публичный статический Метод

Converts backslashes to forward slashes
public static ToUrl ( string fileName ) : string
fileName string /// Filename.
Результат string

UploadHelper() публичный Метод

public UploadHelper ( string dbFileFormat ) : Serenity.ComponentModel
dbFileFormat string
Результат Serenity.ComponentModel