rendered paste body// Upload the next chunk to the server.void WiredTransferSocket::sendNextFileChunk(qint64 theOffset) { const int tmpChunkSize = 32000; if( pSendingFile && pTransfer.pTransferType==1 ) { qDebug() << "Sending"<<theOffset<<"bytes"; pTransfer.pOffset += theOffset; pTransfer.pDoneSize = pTransfer.pOffset; if(!pFile->atEnd()) { // Done! pFile->seek(pTransfer.pOffset); qDebug() << "Sending"<<tmpChunkSize<<"bytes at pos"<<pFile->pos(); QByteArray tmpData = pFile->read(tmpChunkSize); pSocket->write(tmpData); if(pFile->atEnd()) { qDebug() << "We are done. Close."; pSocket->disconnectFromHost(); } } }}