I am trying to execute command like this:
wget --user=abc --ask-password https://xxxxx.com/file.zip
then I have to deliver password.
This code should handle it:
connect(&checkFW, SIGNAL(readyReadStandardOutput()), this, SLOT(readOutput()));
//QString command = "wget --user=abc--ask-password https://xxxxxxx.com";
//checkFW.start("sh",QStringList() << "-c" <<"cd ;"+command);
checkFW.start("wget", QStringList() << "--user=abc" << "--ask-password"<< "https://xxxxxx.com/file.zip");
if (!checkFW.waitForStarted()){
qDebug()<<"Could not start ";
return false;
}
QString cmd = "password\n";
checkFW.write(cmd.toLatin1());
checkFW.waitForFinished(5000);
QByteArray result = checkFW.readAll();
QString mystr(result);
qDebug()<<"output:"<< mystr;
I used QProcess several times but this time I can't manage to work it. Some suggestions? I tried different methotds and any response. Of course the file I reqested was not downloaded.
I checked again and file was download to /home directory, not app's directory. So it works , but there is no output.