ServiceStack adding to allowed File extensions

Hi Guys,

We had a weird problem at work where our font files won’t load.

One of my colleague Dr. Overton who is working on web services using Service stack for one of our project showed me what the problem was.

Now I am 80% web guy and 20% applications. So for once I was like ok its something to do with configurations.

That turned out to be true

By default these extensions are allowed

 

[geshi lang=”csharp” nums=”1″ target=”_self” ]

As you can see that AllowFileExtensions is just a Collection Object property (which we can add extensions to) under class EndPointHostConfig

So within your AppHost.cs file  where you are creating EndpointHostConfig config object as shown below

After this declaration just add required extensions. In our case we want to process few font files that won’t work otherwise without these changes

[geshi lang=”csharp” nums=”1″ target=”_self” ]

 

Advertisement

 

Much thanks to Dr Overton to figure this out.

 

I hope this helps someone

Cheers

VN:F [1.9.22_1171]
Rating: 3.5/5 (2 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
ServiceStack adding to allowed File extensions, 3.5 out of 5 based on 2 ratings

Speak Your Mind

*

CommentLuv badge