I have a byte array filled from a file uploaded. But, in another part of the code, I need to know this file type uploaded from the byte[] so I can render the correct content
You can't know it from the byte stream, but you can store the MIME type when you initially populate the byte[].
byte[]