public static class MyUtils { static string GetOrCreateFilePath(string fileName, string contentRootPath, string filesDirectory = "uploadFiles") { var directoryPath = Path.Combine(contentRootPath, filesDirectory); Directory.CreateDirectory(directoryPath); return Path.Combine(directoryPath, fileName); } public static async Task SaveFileWithName(IFormFile file, string fileSaveName, string contentRootPath) { var filePath = GetOrCreateFilePath(fileSaveName, contentRootPath); await using var fileStream = new FileStream(filePath, FileMode.Create); await file.CopyToAsync(fileStream); } public static string GenerateHtmlForm(string formFieldName, string requestToken) { return $"""



"""; } }