Skip to content

an open source package for uploading and validating all file types in C # and .Net Core projects. With this package, you will no longer need to write code to upload files and validate them. This package includes static methods and parallel programming is used in its coding.

Notifications You must be signed in to change notification settings

ashnoori11/UploadFileExtention_Asp.NetCore

Repository files navigation

UploadFileExtention

A Library to perform file-related operations on the .net core applications

Description

💯 By using this library and adding it to your project, you can skip writing codes for uploading file any types.
🤖 The library also performs rigorous validation when uploading files by check the file mime types.
💥 By adding this package to your project, you can implement the parts related to working with files much faster.
👉 The methods and classes of this library are implemented in static and the codes are implemented executed in parallel.


Methods

Get Content Type

  • GetContentType(string path) returns file type as string

Validation 🧛

  • IsValidFile(byte[] bytFile, FileType flType, string fileContentType) returns bool as result

  • IsValidImageFile(byte[] bytFile, string fileContentType) returns bool as result

  • IsValidVideoFile(byte[] bytFile, string fileContentType) returns bool as result

  • IsValidPdfFile(byte[] bytFile, string fileContentType) returns bool as result

  • IsValidDocDocxFile(byte[] bytFile, string fileContentType) returns bool as result

  • IsValidZipRarFile(byte[] bytFile, string fileContentType) returns bool as result

Upload and Delete Files

  • 🐙 UploadFileAsync(this IFormFile file, string path,FileType type,string fileName="", bool generateNewFileName = false)

  • 🐌 UploadFileBase64(this string base64,string path)

  • 🐳 void(string path)


How To Use

using SecureFileUploadExtention.FileSecurity;

IFormFile file=attachment; var uploadFileResult = await file.UploadFileAsync(path,FileType.Video,file.Name,true);


💝 Dedicated with love to all programmers in the world _ Ashkan Noori 💝

About

an open source package for uploading and validating all file types in C # and .Net Core projects. With this package, you will no longer need to write code to upload files and validate them. This package includes static methods and parallel programming is used in its coding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages