I'm trying to get the simple file extension for example "XLSX","pdf" and so on instead of the whole raw Content-type when I use IFromFile.ContenType gives me the raw content-type header on the uploaded file, any help is really appreciated
For getting file extension from uploaded file (IFormFile), Use:
System.IO.Path.GetExtension(file.FileName)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With