qt - QUrl and QNetworkReply errors -
using qt 5.4 32-bit on windows 8.1 (64-bit) mingw.
i experiencing weird problem. consider this:
//qstring m_surl = "cloud.mysystem.info/"; //qstring m_sfilename = "results.html"; //qnetworkaccessmanager m_manager; qurl url(m_surl + m_sfilename); url.setscheme("ftp"); url.setusername(m_slogin); url.setpassword(m_spassword); qfile *file = new qfile(m_sfilename); if(file->open(qiodevice::readonly)) { qnetworkreply *reply = m_manager.put(qnetworkrequest(url), file); connect(reply, static_cast<void (qnetworkreply::*)(qnetworkreply::networkerror)>(&qnetworkreply::error), this, &ocmresults::error); connect(reply, &qnetworkreply::finished, reply, &qobject::deletelater); connect(reply, &qnetworkreply::finished, file, &qobject::deletelater); } else file->deletelater();
at first code worked fine stopped working (possibly due change, not sure it) , workaround when write url explicitely:
qnetworkreply(qurl("ftp://" + m_slogin + ":" + m_spassword + "@" + m_surl + m_sfilename)), file);
the resulting url same reason when create beforehand , pass qnetworkreply not take it:
reply.url().host()
yields nothing if case example. feel missing obvious here...
the errors either:
3 (host not found) when ftp specified in url string 301 (unknown protocol) when not specify in url specify setscheme("ftp") instead
thanks!
Comments
Post a Comment