stream: set correct content length based on actual size to read and not file size