I am trying to use C# minimal API to develop a WOPI API for office online and on returning file to client i am always getting this error messages:
"Timeout are not supported on this stream".
I am using 'application/octet-stream' HTTP Header.
I am trying to use C# minimal API to develop a WOPI API for office online and on returning file to client i am always getting this error messages:
"Timeout are not supported on this stream".
I am using 'application/octet-stream' HTTP Header.
As you may know it is not possible for JsonSerializer to serialize a stream to return it as response, you have to load your file into byte[] afterward you put it in response body using code like this:
and then in returning part:
of course second part of code should take place in an extension method for Result.Extension somthing like this:
and use it in Program.cs like this: