Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Utils
- {
- public static string GetExtension(this IFormFile file)
- {
- return Path.GetExtension(file.FileName);
- }
- public static byte[] ToByteArray(this IFormFile file)
- {
- using (BinaryReader reader = new BinaryReader(file.OpenReadStream()))
- {
- return reader.ReadBytes((int)file.Length);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement