QNetworkAccessManager *Ftp = new QNetworkAccessManager(this);
QNetworkReply *reply = new QNetworkReply (this);
QUrl url
("ftp://192.168.192.91/test.txt");
url.setUserName(test);
url.setPassword(test);
url.setPort(21);
{
qDebug() << "Could not open file to FTP";
QMessageBox::information(this,
"FTP ",
"Could not open file to FTP");
return false;
}
else
{
reply = Ftp->put(QNetworkRequest(url),data);
}
QNetworkAccessManager *Ftp = new QNetworkAccessManager(this);
QNetworkReply *reply = new QNetworkReply (this);
QUrl url ("ftp://192.168.192.91/test.txt");
url.setUserName(test);
url.setPassword(test);
url.setPort(21);
QFile *data = new QFile(test.txt);
if(!data->open(QIODevice::ReadOnly))
{
qDebug() << "Could not open file to FTP";
QMessageBox::information(this,"FTP ","Could not open file to FTP");
return false;
}
else
{
reply = Ftp->put(QNetworkRequest(url),data);
}
To copy to clipboard, switch view to plain text mode
but i getting error like this
QIODevice::read: device not open
Error Code: "Unknown error"
can anybody tell why it is coming and give some solution....
Bookmarks