/// Processing Description: configure the corresponding port and Conf. setprotocol (qssl: SSLv3 );
//// And handle errors (when connecting to the webpage, an unreliable connection or untrusted connection will be prompted. In this case, ignore and continue)
//// Processing of the following primary tasks: In in
Qnetworkaccessmanager * networkmng; // connection
Qnetworkreply * reply; // Network Response
Connect (networkmng, signal (sslerrors (qnetworkreply *, const qlist <qsslerror> &)),
This, slot (slotsslerrordeal (qnetworkreply *, const qlist <qsslerror> &)));
Qurl urltemp (m_serverurl );
Urltemp. setport (ihttpsport); // set the port number here
Qnetworkrequest requesttemp (urltemp );
Requesttemp. setheader (qnetworkrequest: contenttypeheader, "application/zip ");
Requesttemp. setrawheader ("FILENAME", logfile. toutf8 ());
Qsslconfiguration conf = requesttemp. sslconfiguration ();
Conf. setprotocol (qssl: SSLv3 );
Requesttemp. setsslconfiguration (CONF );
Reply = mp_networkmng-> post (requesttemp, l_content );
Connect (reply, signal (finished ()),
This, slot (slotuploadlogfinished ()));
// Waiting for upload
Int waitcount = 1;
While (waitcount)
{
Sleep (10000 );
Waitcount --;
}
//// End
////// The error handling is as follows:
Void cmyclass: slotsslerrordeal (qnetworkreply * reply, const qlist <qsslerror> & errors)
{
Qlist <qsslerror >:: const_iterator conit = errors. Begin ();
While (conit! = Errors. End ())
{
Qstring stemp = (* conit). errorstring ();
Writetestdebuglog (stemp); // print the Error Log
Qdebug () <(* conit). errorstring ();
++ Conit;
}
Reply-> ignoresslerrors ();
Return;
}
/// // End