Hi!
I've a simple code to download "path" file to "file" on my disk.
connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpRequestFinished(int, bool)));
file = new QFile(fileName
);
qDebug() << "open file error";
delete file;
file = 0;
return;
}
QHttp::ConnectionMode mode
= url.
scheme().
toLower() == "https" ?
QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp;
http->setHost(url.host(), mode, url.port() == -1 ? 0 : url.port());
QByteArray path
= QUrl::toPercentEncoding(url.
path(),
"!$&'()*+,;=:@/");
httpGetId = http->get(path, file);
QHttp *http = new QHttp(this);
connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpRequestFinished(int, bool)));
QUrl url(StrUrl);
file = new QFile(fileName);
if (!file->open(QIODevice::WriteOnly)) {
qDebug() << "open file error";
delete file;
file = 0;
return;
}
QHttp::ConnectionMode mode = url.scheme().toLower() == "https" ? QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp;
http->setHost(url.host(), mode, url.port() == -1 ? 0 : url.port());
QByteArray path = QUrl::toPercentEncoding(url.path(), "!$&'()*+,;=:@/");
httpGetId = http->get(path, file);
To copy to clipboard, switch view to plain text mode
If i write path like:
http://www.qtcentre.org/forum/newthread.php
http://www.qtcentre.org/forum/newthread.php
To copy to clipboard, switch view to plain text mode
i's doing right, but when I connect to get fields (ex. do=newthread&f=4) to string
http://www.qtcentre.org/forum/newthread.php?do=newthread&f=4
http://www.qtcentre.org/forum/newthread.php?do=newthread&f=4
To copy to clipboard, switch view to plain text mode
the get field is not pas :/
I'm using simple code in PHP to test
echo 'OK';
print_r($_REQUEST);
echo 'OK';
print_r($_REQUEST);
To copy to clipboard, switch view to plain text mode
And I get empty $_REQUEST :/
Bookmarks