Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Sending whole file at a time in tcp communication
ecmanja last edited by
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.
gyll last edited by
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.
KA51O last edited by
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