Advertisement
libdo

Untitled

Sep 17th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static class Utils
  2. {
  3. public static string GetExtension(this IFormFile file)
  4. {
  5. return Path.GetExtension(file.FileName);
  6. }
  7. public static byte[] ToByteArray(this IFormFile file)
  8. {
  9. using (BinaryReader reader = new BinaryReader(file.OpenReadStream()))
  10. {
  11. return reader.ReadBytes((int)file.Length);
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement