C# Class Serenity.Web.UploadHelper

Exibir arquivo Open project: volkanceylan/Serenity Class Usage Examples

Public Methods

Method Description
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

Method Details

CheckFileNameSecurity() public static method

public static CheckFileNameSecurity ( string fileName ) : void
fileName string
return void

CopyFileAndRelated() public static method

public static CopyFileAndRelated ( string sourceFilePath, string targetFilePath, bool overwrite = false ) : void
sourceFilePath string
targetFilePath string
overwrite bool
return void

CopyFileAndRelatedToHistory() public static method

public static CopyFileAndRelatedToHistory ( string sourceFilePath ) : string
sourceFilePath string
return string

CopyTemporaryFile() public method

public CopyTemporaryFile ( string dbTemporaryFile, object entityId, FilesToDelete filesToDelete, string>.Func fileNameReplacer = null ) : CopyTemporaryFileResult
dbTemporaryFile string
entityId object
filesToDelete FilesToDelete
fileNameReplacer string>.Func
return CopyTemporaryFileResult

CopyTemporaryFile() public method

public CopyTemporaryFile ( string dbTemporaryFile, object entityId, string>.Func fileNameReplacer = null ) : CopyTemporaryFileResult
dbTemporaryFile string
entityId object
fileNameReplacer string>.Func
return CopyTemporaryFileResult

DbFilePath() public static method

public static DbFilePath ( string dbFileName ) : string
dbFileName string
return string

DeleteFileAndRelated() public static method

public static DeleteFileAndRelated ( string dbFileName, DeleteType deleteType ) : void
dbFileName string
deleteType DeleteType
return void

FileNameSizeDisplay() public static method

public static FileNameSizeDisplay ( string name, int bytes ) : string
name string
bytes int
return string

FileSizeDisplay() public static method

public static FileSizeDisplay ( int bytes ) : string
bytes int
return string

FormatDbFileName() public method

public FormatDbFileName ( object entityId, string extension ) : string
entityId object
extension string
return string

FormatDbFileName() public static method

public static FormatDbFileName ( string format, object identity, string extension ) : string
format string
identity object
extension string
return string

GetMimeType() public static method

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.
return string

GetThumbFileName() public static method

public static GetThumbFileName ( string fileName, string thumbSuffix = "_t.jpg" ) : string
fileName string
thumbSuffix string
return string

ImageFileUrl() public static method

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.
return string

RegisterFilesToDelete() public static method

public static RegisterFilesToDelete ( IUnitOfWork unitOfWork, FilesToDelete filesToDelete ) : void
unitOfWork IUnitOfWork
filesToDelete FilesToDelete
return void

ToPath() public static method

Converts forward slashes to backslashes
public static ToPath ( string fileName ) : string
fileName string /// Filename.
return string

ToUrl() public static method

Converts backslashes to forward slashes
public static ToUrl ( string fileName ) : string
fileName string /// Filename.
return string

UploadHelper() public method

public UploadHelper ( string dbFileFormat ) : Serenity.ComponentModel
dbFileFormat string
return Serenity.ComponentModel