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.
PackageManager : Install-Package UploadFileExtentions -Version 2.0.0
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)
using SecureFileUploadExtention.FileSecurity;
IFormFile file=attachment; var uploadFileResult = await file.UploadFileAsync(path,FileType.Video,file.Name,true);