webapi streaming



If you need to stream a video from webapi, you can use the following codes. The code is taken from stackvoerflow. I did not write it.

If you're using .net core, use the following code.





There are loads of sample in the internet, but i think this works well for .net 4.6.

You probably need to know that if you not sure exact size of your files, try PushStreamContent.
Otherwise, you can just use StreamContent.




Comments

Popular posts from this blog

PySpark - Working with JDBC Sqlite database