It's better to just do a stream with a buffer, and when the client sends the EOF you know that you have all the data