You need to add a mechanism (in readyRead()) to differentiate between a chat message, and a file message. One way I suggested earlier