Asp.net mvc return actionresult for video

What action result should I use when I try to return mp4 video using asp.net mvc csharp?

Currently, I hide my videos behind the method in order to protect it from unauthorized access. I call these clips from JWPlayer in a web browser. However, the title information does not appear to be available or the video is prepared for download and not for playback. Something strange, one way or another.

How do I return a file? Should I include additional headers?

This is what I am doing now:

return File(path, file.MimeType, fileName); 
+4
source share
1 answer

Create a custom ActionResult.

Here is an example image I used to create one for pdf, the concept should be the same for any type of file.

0
source

All Articles