title: QFtp get not working
body: <p>Greeting</p>
  
  <p>Im trying to download file with <code>QT 4.8</code> and <code>VS 2008</code> but i cant, It fail all the time.</p>
  
  <p>I use following code to download file from FTP server.</p>
  
  <pre><code>void FTP::download(QString strFileName, QString strFTPFileName)
  {
      QFile * file = new QFile(strFileName);
      if (m_fFile-&gt;open(QIODevice::ReadWrite))
      {
          QString strFtpServerIPAddress("192.168.7.10");
          QString strFtpServerPortNumber("21");
          QString strFtpUserName("admin");
          QString strFtpPassword("admin");
          QString strFtpFolderPath("\outgoing\");
          qint16 iFtpPort = 21;
  
          QFtp * ftp = new QFtp();    
          connect(ftp, SIGNAL(stateChanged(int)),SLOT(onStateChanged(int)));
          connect(ftp, SIGNAL(done(bool)),SLOT(onDone(bool)));
          connect(m_objFtp, SIGNAL(commandFinished(int, bool)),SLOT(onCommandFinished(int, bool)));
  
          int iConnectToHostID = ftp-&gt;connectToHost(strFtpServerIPAddress, iFtpPort);
          int iLogInID = ftp-&gt;login(strFtpUserName, strFtpPassword); 
          int iChangeDirectoryID = ftp-&gt;cd(strFtpFolderPath);
  
          QFileInfo fileInfo(strFTPFileName);
          QString strFileNameOnly(fileInfo.fileName());
          int iOperationID = ftp-&gt;get(strFileNameOnly, file);
  
          QEventLoop loop;
          connect(this, SIGNAL(finished()), &amp;loop, SLOT(quit()));
          loop.exec();
  
          ftp-&gt;close();
          file-&gt;close();
          delete ftp;
      }
  }
  
  void FTP::onDone(bool bError)
  {
      ...
      //If "id" (saved from onStateChanged) is equal to "iOperationID", I emit "finished" Signal
      ...
  }
  </code></pre>
  
  <p>I was checking <code>onCommandFinished</code> slot and all steps (HostLookup, Connecting, Connected, LoggedIn) finish without error but exactly in <code>get</code> operation, <code>error</code> is <code>true</code> and when i get detail about error with following codes ,</p>
  
  <pre><code>string strReason = QFtp::errorString().toStdString();
  int iError = QFtp::error();
  </code></pre>
  
  <p><code>strReason</code> is <code>Unknown error</code> and <code>iError</code> is <code>0</code>.</p>
  
  <p>Any idea what is going wrong here ?</p>
  
  <p>Thanks in advanced</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>I found the problem. Some how i cant download file from root directory, If i try to download file inside another directory, It work.</p>
  
  <p>In my code , I check if <code>strFtpFolderPath</code> is empty or equal to ".", In this case i change directory with <code>ftp-&gt;cd("/")</code> other wise i set it to given path.</p>
  
  <p>Any idea why i cant download file from root directory?    </p>