I'm working on an ASP.NET MVC project in in C#, trying to get upload a document from a form to my database. I'm currently in my controller where I have imported the file as HttpPostedFileBase, and it has to be converted to type Stream. How could I achieve this?
Thanks in advance!
HttpPostedFileBase document = form.DocumentFile;
Stream documentConverted = ?;
var document = form.DocumentFile;
Stream documentConverted = document.InputStream;
Got it! I have to use .Inputstream
to convert it directly.