Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 548875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:07:33+00:00 2026-05-13T11:07:33+00:00

Hello i am learning qt and trying to upload a file using QFtp i

  • 0

Hello i am learning qt and trying to upload a file using QFtp i wrote the folowing code

this->connect(this->ftp, SIGNAL(done(bool)), this, SLOT(ftpDone(bool)));
this->connect(this->ftp, SIGNAL(dataTransferProgress(qint64, qint64)), this, SLOT(dataTransferProgress(qint64, qint64)));
this->connect(this->ftp, SIGNAL(stateChanged(int)), this, SLOT(stateChanged(int)));

…..

if(this->file.open(QIODevice::ReadWrite))
{
    this->ftp->setTransferMode(QFtp::Active);
    this->ftp->connectToHost(this->settings->getHost());
    this->ftp->login(this->settings->getUser(), this->settings->getPassword());
    this->ftp->cd(remoteFilePath);
    this->ftp->get(this->fileName, &this->file);
    this->ftp->close();
}

and it kind of stops it reports in dataTransferProgress that it is at 0/XXX but the slot is never invoked again (using the same code but with the get function i can download a file and it works without a problem) also the error that i get after the time out is QFtp::UnknownError.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:07:34+00:00Added an answer on May 13, 2026 at 11:07 am

    Assuming all the commands until get are successful, it’s likely that you are closing the connection before get finishes. You should save the identifier returned by get and call close when the commandFinished signal is called with that identifier.

    Note: Except setTransferMode all of the methods you used are asynchronous. They will be executed in the order that they are called, but since you aren’t performing any error checking, it’s possible for one to fail and the rest will still be attempted which might result in some confusion.

    The proper way of doing this is to connectToHost first, if that’s successful (you can track this with the commandFinished signal) call login etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning this stuff and trying to understand it, so am using this
hello i'm learning qt and i'm doing the folowing to add some widgets to
Hello Guys! I started learning python GUI development. Let's say I have this script:
I just started learning C, and wrote my hello world program: #include <stdio.h> main()
I just started learning C, and wrote my hello world program: #include <stdio.h> main()
Hello I am just learning postGIS and thus postgresql (9.1) and am trying to
hello im new and learning javascript. I'm trying to make a program of addition
Hello I am trying to read my xml document using xpath. I have been
I'm learning Squeryl and trying to understand the 'using' syntax but can't find documentation
I am trying to teach myself WCF (using Learning WCF by Michele Leroux Bustamante),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.