hi,
im using qt4.5.2 in debian. i want to download a file from web.
so i used the following code
QNetworkAccessManager *manager=new QNetworkAccessManager;
QString url
="ftp://ftp.trolltech.com/qt/source/INSTALL";
QNetworkReply *reply = manager->get(QNetworkRequest(url));
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
file.write(reply->readAll());
delete reply;
QNetworkAccessManager *manager=new QNetworkAccessManager;
QString url="ftp://ftp.trolltech.com/qt/source/INSTALL";
QNetworkReply *reply = manager->get(QNetworkRequest(url));
QEventLoop loop;
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
QString filename="INSTALL";
QFile file(filename);
file.open(QIODevice::WriteOnly);
file.write(reply->readAll());
delete reply;
To copy to clipboard, switch view to plain text mode
above code works perfect. But i failed to download from a ftp site ,with login/pwd.
ex;
if i changed the
QString url
="ftp://username:pwd@mysys.com/filename";
QString url="ftp://username:pwd@mysys.com/filename";
To copy to clipboard, switch view to plain text mode
download fails.
but when i paste the same in Browser, i can able to download the file.
what im doing wrong?
how to download a file with username , pwd?
pls guide me
Bala
Bookmarks