Dear freinds,

I am facing a problem of transferring a file in a mini chat.
After clicking on the upload buton, I get directory where the file is saved, but I can find file itself.

Here is my code:

Qt Code:
  1. void FenClient::sendFile()
  2. {
  3. QString fileName = QFileDialog::getOpenFileName(this, "Information", "Open a file",
  4. "File(*.text *.png *.jpeg *.gif)");
  5. m_file = fileName;
  6. QFile file(fileName);
  7.  
  8. if(!file.open(QIODevice::ReadOnly))
  9. {
  10. return;
  11. }
  12.  
  13. QByteArray paquet = file.readAll();
  14. QDataStream out(&paquet, QIODevice::WriteOnly);
  15. out<< (quint32) 0;
  16. out<< (quint32)(file.size()-sizeof(quint32));
  17. m_socket->write(paquet);
  18. }
To copy to clipboard, switch view to plain text mode 

Could you please tell me what is missing in my code and how to fix the problem?

Many thanks.