Fredrick Lackey - 139 - Feb 20, 2014

ProtoBuf or Streaming?  Which is preferred for file transfers >= 10MB?  Do any end-to-end examples exist using ProtoBuf with ServiceStack for both directions?

They’re very different things. To upload a file I would stick to a standard HTTP File upload, if you’re using the C# client see: 
https://github.com/ServiceStack/ServiceStack.Examples/blob/master/src/RestFiles/RestFiles.Tests/SyncRestClientTests.cs#L107

Fredrick Lackey:

Hmm… confused.  I’ve used the RestFiles example successfully to a point.  Files over ~4MB cause exceptions.  Then found a post where you mentioned ProtoBuf so I’ve started looking for more concrete examples.  What method would you recommend for files larger files?  The link I referred to: http://stackoverflow.com/questions/15687845/send-a-large-message-to-a-servicestack-service

Large message is not the same thing as a large file. If you’re uploading files best to stick the HTTP conventions so they can he accessed from web browsers if needed. The easiest thing to do is HTTP POST a file, if you’re hosting on ASP.NET you should increase the built-in ASP.NET resource limits, see:
http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx

Streaming is a possibility but its not built into the ServiceClients so you would have to use .NET’s HTTP Clients directly and post to a special service that parses the Streamed request as done in: http://www.codeproject.com/Articles/501608/Sending-stream-to-ServiceStack

Dylan v.d Merwe:

Set the maxRequestLength in the config file to a greater value than 4MB?

Fredrick Lackey:

That’s the route I was going to go (increased length setting & raw client) but wanted to ensure there wasn’t a better magical ServiceStack method first.  This’ll never be accessed from a browser directly.  The most obscure client would be a compiled Xamian / Mono version.

Note: You’re still likely to hit ASP.NET Request limits no matter what method you’re using to POST the data, unless you use compression to reduce the bytes sent.