You are assuming that the entire file arrives and is announced by a single readyRead() signal. This will not be the case and is the cause of your truncated file.
You are also treating your incoming data stream as if it was text, (e.g. With readline()) which is at odds with the QDataStream you used at the other end.