namespace UGQApiServer.Storage; public class LocalStorageService : IStorageService { public LocalStorageService() { } public string fileUrl(string filename) { return filename; } public async Task uploadFile(string filename, IFormFile file) { await Task.CompletedTask; string path = Path.Combine(Directory.GetCurrentDirectory(), "files"); if (!Directory.Exists(path)) Directory.CreateDirectory(path); using (var stream = new FileStream(Path.Combine(path, filename), FileMode.Create)) { file.CopyTo(stream); } return true; } public async Task deleteFile(string filename) { await Task.CompletedTask; System.IO.File.Delete(filename); return true; } }