You can read the posted contents of the file as a
Stream
. In ASP.NET MVC5, use
the InputStream property[
^]; in ASP.NET Core / .NET 5, use
the OpenReadStream method[
^].
Obviously whatever you're using to load data from that file will need to support reading from a stream. As an example, if you're using OLEDB to read an uploaded Excel file, that requires a physical file on your server's disk. But you may be able to use
The OpenXML SDK[
^] to read the file directly from the stream instead.