1

I have a ServiceStack service that returns video files as a download. The code that accomplishes this is below. It works (the video plays) on all devices except iOS. After some research, it appears that that httphandler needs to be customized to support "range-specific" requests. A description of this issue can be found in the following url.

http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx

I'm wondering if I can customize ServiceStack (and my download code below) to support range-specific requests. Thank you.

  if (fi.Exists)
                {
                    //optimized way according to mythz
                    var aspRes = (System.Web.HttpResponse)base.RequestContext.Get<IHttpResponse>().OriginalResponse;
                    //aspRes.ContentType = "application/octet-stream";
                    aspRes.ContentType = "video/mp4";
                    aspRes.AppendHeader("Content-Disposition", "attachment; filename=" + fi.Name);
                    aspRes.AddHeader("content-length", fi.Length.ToString());
                    aspRes.TransmitFile(fi.FullName);
                    return null;
                }

1 Answer 1

1

Note: the website I linked above has code for implementing an MP4DownloadHandler that can be plugged in and used to support range-specific download requests. You have to register this handler with ServiceStack. So this question isn't relevant anymore.

I do have a related question, though (linked below) about the ability to access the cache client now that I've bypassed ServiceStack from within my custom IHTTPHandler.

I bypassed servicestack to implement my own IHTTPHandler, but now I want access to the cache

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.