Increase maxRequestLength in ServiceStack for a specific route

So, I recently wrote a simple service for uploading files to my server. Everything is working fine. My web.config looks like this (maximum upload size is limited to 20 MB):

<configuration> <system.web> <httpRuntime maxRequestLength="20480" executionTimeout="600" /> <httpHandlers> <add path="api*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" /> </httpHandlers> ... </system.web> </configuration> 

All my routes start with / api /, for example, my download service is located in / api / documents / upload.

Now my question is: is it possible to determine different download sizes for different services? (in my example, each service is limited to 20 MB!)

I tried some things with the location tag, but it did not work with the httpRuntime tag. Has anyone already tried something like this?

+8
c # web-config servicestack
source share
1 answer

Use the location element, it should work (check the path without ~/ )

 <configuration> <location path="api/documents/upload"> <system.web> <httpRuntime maxRequestLength="20480" /> </system.web> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="20971520" /> </requestFiltering> </security> </system.webServer> </location> </configuration> 
+2
source share

All Articles