added sfloader for file uploads.

This commit is contained in:
ivancheahhh
2024-01-03 14:37:04 -07:00
parent 193a2ab471
commit af75f1fe6b
14 changed files with 171 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
{
public interface IFileHelper
{
string GetFullFilePath(string currentFilePath);
public string MoveFileFromTemp(string currentFilePath, string newFolder);
public bool DeleteFile(string currentFilePath);
}
@@ -12,6 +13,21 @@
{
_webEnv = webEnv;
}
public string GetFullFilePath(string currentFilePath)
{
if (currentFilePath.StartsWith("/"))
{
currentFilePath = currentFilePath.Substring(1);
}
string oldFilePath = Path.Combine(_webEnv.WebRootPath, currentFilePath);
if (File.Exists(oldFilePath))
{
return oldFilePath;
} else
{
return string.Empty;
}
}
public string MoveFileFromTemp(string currentFilePath, string newFolder)
{
string tempPath = "temp/";