Just to add:
Large data packages don't has to be sent at once through TCP, so you can receive your data in many packages (every time readyRead() will be emitted) so just save expected data size (from that first 'special' package) and then in in slot on readyRead check with bytesAvailable() how many bytes received. If you got less then you are waiting for, then save all the data in some buffer (QByteArray or write directly to file but you can withour readLine() just write what readAll() returns), substract bytesAvailable from all required bytes count and keep waiting for another readyRead() and so on until you get all required data. Then you have complete package in your buffer.