I need to send a sqlite file up to a website using post. So what I do is that I open the file and try to read the content of it into a QString that I with help of QNetworkRequest can send to the server. I can handle the request as the file is sent to the server but the file is just empty. The QString str here is always empty. Am I reading the content of the sqlite file wrong? Can you anything wrong with my code?

This is the code for reading the file:
Qt Code:
  1. QFile file("database.sql"); //I have tested that this excists
  2. file.open(QIODevice::ReadOnly);
  3. QDataStream in(&file);
  4. QString str;
  5. in.setVersion(QDataStream::Qt_4_6);
  6. in >> str; //str is always empty here
To copy to clipboard, switch view to plain text mode