QHttp GET File & Password
How to set password format to send on a server...
I suppose not set on plain text ... hash or md5???
Server apache2 make Ldap autenfication but is similar to .htpasswd
http = new QHttp(this);
http->setHost(urls.host(),80);
http->setUser( current_user , current_pass );
Code:
void Gui_Wget::downloadFile()
{
if (url.size() > 1 || currentfile.size() > 1 )
{
if (is_file(currentfile)) {
qt_unlink(currentfile);
}
file = new QFile(currentfile
);
tr("Unable to save the file %1: %2.")
.arg(currentfile).arg(file->errorString()));
delete file;
file = 0;
return;
}
stopButton->setEnabled(true);
http->setHost(urls.host(),80);
http->setUser( current_user , current_pass );
statusLabel->setText(tr("Download Url:")+" "+url);
connect(http, SIGNAL(dataReadProgress(int, int)),this, SLOT(updateDataReadProgress(int, int)));
connect(http, SIGNAL(requestFinished(int, bool)),this, SLOT(httpRequestFinished(int, bool)));
connect(http, SIGNAL(dataReadProgress(int, int)),this, SLOT(updateDataReadProgress(int, int)));
connect(stopButton, SIGNAL(clicked()), this, SLOT(cancelDownload()));
httpRequestAborted = false;
httpGetId = http->get(urls.path(), file);
downloadButton->setEnabled(false);
}
}
Re: QHttp GET File & Password
Re: QHttp GET File & Password
so now by pass & user are 3 request!
and must switch if user & pass ist set.... or only a simple get ....
Code:
{
if (responseHeader.statusCode() != 200) {
tr("Download failed message: %1. \nRemote file %2 not respond!")
.arg(responseHeader.reasonPhrase() , url ));
httpRequestAborted = true;
http->abort();
stopButton->setEnabled(false);
emit ready_action();
return;
}
}
Re: QHttp GET File & Password
Sorry, I don't have the slightest idea what you mean...
Re: QHttp GET File & Password
readResponseHeader make 3 signal but now is running .... if isset password or no..
I have post example to http://www.qtforum.de/forum/viewtopic.php?t=2269 on Snippets, Tipps & Tricks .... on german forum ... this forum not have a Snippets section ... ( as archive) :rolleyes: is similar from qt4 http demo but other signal!