Sending whole file at a time in tcp communication
how can i send whole file at a time using tcp/ip , just like how we send file in gmail.. can anyone help me out regrading this.
you take the file, wrap it in a plastic sheet (or you can pack it in a cardboard box if you like that better), and then push it down the pipe. it's that easy.
just use "QTcpSocket::write(QByteArray)":http://qt-project.org/doc/qt-4.8/qiodevice.html#write-3 QTcpSocket derives from QAbstractSocket, which in turn derives from QIODevice.
Of course its not all that easy because you also need to send some meta data info (file type et al) along with the actual file.
Another option would be to use "QNetworkAccessManager::post() ":http://qt-project.org/doc/qt-4.8/qnetworkaccessmanager.html#post