Skip to content

A lightweight file service for handling uploads, saving to local or FTP storage, and deleting files using IFormFile in ASP.NET Core.

Notifications You must be signed in to change notification settings

TS-NuGet-Packages/TS.FileService

Repository files navigation

TS.FileService

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.

Install

dotnet add package TS.FileService

Usage

If 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);

About

A lightweight file service for handling uploads, saving to local or FTP storage, and deleting files using IFormFile in ASP.NET Core.

Topics

Resources

Stars

Watchers

Forks

Languages