Class FormFileManager
- Namespace
- JJMasterData.Core.DataManager.IO
- Assembly
- JJMasterData.Core.dll
public class FormFileManager
- Inheritance
-
FormFileManager
- Inherited Members
Constructors
FormFileManager(string, IHttpContext, IStringLocalizer<MasterDataResources>, ILogger<FormFileManager>)
public FormFileManager(string memoryFilesSessionName, IHttpContext httpContext, IStringLocalizer<MasterDataResources> stringLocalizer, ILogger<FormFileManager> logger)
Parameters
memoryFilesSessionName
stringhttpContext
IHttpContextstringLocalizer
IStringLocalizer<MasterDataResources>logger
ILogger<FormFileManager>
Properties
AutoSave
Always apply changes from files on disk, if it is false, keep it in memory Default: true
public bool AutoSave { get; set; }
Property Value
FolderPath
Full Directory Path.
(Optional) If the path is not given, all files will be stored in the session.public string FolderPath { get; set; }
Property Value
Remarks
The path is OS agnostic, you can use for example C:\Temp\Files\ or /home/gumbarros/Documents/Files, but beware where you're deploying your application.
MemoryFiles
public List<FormFileInfo> MemoryFiles { get; set; }
Property Value
Methods
CountFiles()
public int CountFiles()
Returns
CreateFile(FormFileContent, bool)
public void CreateFile(FormFileContent fileContent, bool replaceIfExists)
Parameters
fileContent
FormFileContentreplaceIfExists
bool
DeleteAll()
public void DeleteAll()
DeleteFile(string)
public void DeleteFile(string fileName)
Parameters
fileName
string
GetFile(string)
public FormFileInfo GetFile(string fileName)
Parameters
fileName
string
Returns
GetFilePath(string)
public string GetFilePath(string fileName)
Parameters
fileName
string
Returns
GetFiles()
public List<FormFileInfo> GetFiles()
Returns
RenameFile(string, string)
public void RenameFile(string currentName, string newName)
Parameters
SaveMemoryFiles(string)
public void SaveMemoryFiles(string folderPath)
Parameters
folderPath
string
Events
OnBeforeCreateFile
public event EventHandler<FormUploadFileEventArgs> OnBeforeCreateFile
Event Type
OnBeforeDeleteFile
public event EventHandler<FormDeleteFileEventArgs> OnBeforeDeleteFile
Event Type
OnBeforeRenameFile
public event EventHandler<FormRenameFileEventArgs> OnBeforeRenameFile