TS.FileService is a lightweight utility library for handling common file operations in .NET applications. It provides simple and reliable methods for saving files to the server, converting files into byte arrays for database storage, and deleting files from disk. Designed to be minimal and dependency-free, it fits perfectly into Web API, Minimal API, MVC, and other backend architectures where easy file management is needed.
dotnet add package TS.FileServiceIf you want to save file in server
string filePath = "./Files/";
string fileName = FileService.FileSaveToServer(file,filePath);If you want to save file in Database (byte[])
byte[] fileByeArray = FileService.FileConvertByteArrayToDatabase(file);If you want to delete file in server
string path = "./Files/" + "FileName";
FileService.FileDeleteToServer(path);