I have a site that allows users to upload a document such as pdf, word, excel etc.
Now in my code, when I want to show the document in a browser, I am checking for the extension and setting the ContentType appropriately.
However, this switch statement just doesn't sound like the best solution.
Is there a way I can set the content type based on the Stream
?