1
Vote

ResumingFilePathResult returns string instead of file

description

I am using ResumingFilePathResult stream video in my MVC application, in my development system it is working fine. But in production system it is not working, instead of returning file, it is displaying some content like this.

VikingErik.Mvc.ResumingActionResults.ResumingFilePathResult

Please help.

comments

VikingErik wrote May 8, 2014 at 6:51 PM

That's strange. It's like the framework is just calling ToString() on the object. Maybe there is a problem that the resource was inaccessible from the production system?

anuraj_p wrote May 9, 2014 at 12:17 AM

I am not sure, it was working with FileAction result, let me see any inaccessible issue exists. Is there any relation with IIS? I think IIS versions are different.

VikingErik wrote May 9, 2014 at 3:41 PM

I don't see how it would be an IIS problem if IIS is working with MVC correctly. This version of the library is compatible with MVC version 2 and built for the .NET 2.0 runtime. There shouldn't be any extra requirements as far as I can tell. Can you do a Fiddler capture of the traffic and report back on the HTTP code, content type and content please?

anuraj_p wrote May 12, 2014 at 11:34 AM

Please find the details

GET http://0.0.0.0/VideoLibrary/Movie/ShowMovie/fe1cdf40-9793-4f95-8680-e91d17d0f8a5.mp4 HTTP/1.1
Host: 0.0.0.0
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
Accept: /
Referer: http://0.0.0.0/VideoLibrary
Accept-Language: en-US,en;q=0.8,ml;q=0.6
Range: bytes=0-58


Response

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNetMvc-Version: 4.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 12 May 2014 11:30:15 GMT
Content-Length: 59

VikingErik.Mvc.ResumingActionResults.ResumingFilePathResult

Please let me know if you require any information.

It is working, if we return FileActionResult class.

anuraj_p wrote May 12, 2014 at 11:34 AM

Please find the details

GET http://0.0.0.0/VideoLibrary/Movie/ShowMovie/fe1cdf40-9793-4f95-8680-e91d17d0f8a5.mp4 HTTP/1.1
Host: 0.0.0.0
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
Accept: /
Referer: http://0.0.0.0/VideoLibrary
Accept-Language: en-US,en;q=0.8,ml;q=0.6
Range: bytes=0-58


Response

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNetMvc-Version: 4.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 12 May 2014 11:30:15 GMT
Content-Length: 59

VikingErik.Mvc.ResumingActionResults.ResumingFilePathResult

Please let me know if you require any information.

It is working, if we return FileActionResult class.

VikingErik wrote May 18, 2014 at 7:26 PM

I've set up a test harness and it's working as it should.
Are you using the latest NuGet package?
How are you instantiating / returning the ResumingFilePathResult?

In my quick test, I'm using the very large Big Buck Bunny video file. When I return this, the action can get called a few times in a row as different devices query byte ranges in different ways. Still I get the video and can jump around in the stream without delay.

var path = Server.MapPath("/Content/Media/big_buck_bunny_1080p_h264.mov");
return new ResumingFilePathResult(path, "video/mp4");

If I alter the content type to something else, the browser gets a download prompt rather than attempt to stream but it's still the full 200+MB file, not a string representation of the object.

The latest DLLs are on NuGet http://www.nuget.org/packages/MVC.ResumingActionResults/ and this is what I'm using in my test (not a local build of the source).