hexie
12th March 2012, 08:24
I tried to dowload multiple files using a loop.
I downloaded 2 files, but the 1st one's size is about 3kb smaller than that in the ftp.
Please help me solve it.Thank you.
Sorry for my poor English.
ftp2 = new QFtp;
connect(ftp2, SIGNAL(done(bool)), this, SLOT(ftpDone2(bool)));
ftp2->connectToHost(url.host(), url.port(21));
ftp2->login(url.userName(), url.password());
//loop start
QString localFileName = QFileInfo(url.path()).fileName();
file = new QFile(localFileName);
ftp2->get(url.path(), file);
//loop end
void Update::ftpDone2(bool error)
{
file->close();
//something else
return;
}
Added after 41 minutes:
I knew how to solve it
C++ Gui Proggramming with Qt4
chap15 spider example
I downloaded 2 files, but the 1st one's size is about 3kb smaller than that in the ftp.
Please help me solve it.Thank you.
Sorry for my poor English.
ftp2 = new QFtp;
connect(ftp2, SIGNAL(done(bool)), this, SLOT(ftpDone2(bool)));
ftp2->connectToHost(url.host(), url.port(21));
ftp2->login(url.userName(), url.password());
//loop start
QString localFileName = QFileInfo(url.path()).fileName();
file = new QFile(localFileName);
ftp2->get(url.path(), file);
//loop end
void Update::ftpDone2(bool error)
{
file->close();
//something else
return;
}
Added after 41 minutes:
I knew how to solve it
C++ Gui Proggramming with Qt4
chap15 spider example