Try our conversational search powered by Generative AI!

Serving Blobs in CustomFileHandler


Hi, there,

I need to do some extra processing on a media type. I am following the code sample provided on this page.

I have confirmed that the handler gets called when that media type is called. The issue is that it is not returning the pdf file.

So I have two questions. First, is there a method that the framework provides to serve blobs?

And the second question. In case there is no method to server blobs, is there a method to turn blobs into a Binary Stream?

Thanks in advance.

Oct 21, 2015 23:34

I have the same problem. Did you solve this problem?

Best Regards


Jun 03, 2016 14:54

Hi Anders (and Hugo).

We've previously done numourous implementations relying on a custom HttpHandler for Media in Episerver. It has e.g. been used for tracking downloads and enforcing access control for first download (kind of a gated approach to documents).

I've shared some of the important code from our implementation as a Gist on Github. I hope that can help you move forward. Be aware that it has been taken out a bigger context.

Casper Aagaard Rasmussen

Jun 03, 2016 17:18

Hi Casper,

Thank you very much. We changed some code in your example and now everything is working as we like :)

Best Regards

Jun 07, 2016 13:37
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.