
Originally Posted by
bender86
[CODE]...
I think it should be:
http->setHost("localhost");
http->get("/mysite/lastrelease.xml");
http->setHost("localhost");
http->get("/mysite/lastrelease.xml");
To copy to clipboard, switch view to plain text mode
It gives the same problem.
I have also tried to get some page from the remote site, but nothing changes. Using QTemporaryFile gives the segmentation fault; with QFile an empty output.
Try this:
if(!file.open()) {
}
QUrl url
("http://www.bzip.org");
http->setHost(url.host(), url.port(80));
http->get("/docs.html", &file);
http->close();
QTemporaryFile file;
if(!file.open()) {
QMessageBox::critical(0,QString(),tr("Can't open the file!"));
}
QUrl url("http://www.bzip.org");
http = new QHttp;
http->setHost(url.host(), url.port(80));
http->get("/docs.html", &file);
http->close();
To copy to clipboard, switch view to plain text mode
or this:
QFile file("/tmp/output.html");
}
QUrl url
("http://www.bzip.org");
http->setHost(url.host(), url.port(80));
http->get("/docs.html", &file);
http->close();
QFile file("/tmp/output.html");
if(!file.open(QIODevice::ReadWrite)) {
QMessageBox::critical(0,QString(),tr("Can't open the file!"));
}
QUrl url("http://www.bzip.org");
http = new QHttp;
http->setHost(url.host(), url.port(80));
http->get("/docs.html", &file);
http->close();
To copy to clipboard, switch view to plain text mode

Originally Posted by
bender86
Is /tmp writable? Try another directory (like $HOME).
Of course /tmp is writable.
Regards
Bookmarks