Hello Christian,
I have used your test application to write a code to download a file from a web server. It is working fine thanks.
Now I would to write a code to upload a file to a web server.
I have modified your code as follows:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
void MainForm::getFile()
{
fileGet->setName("Basistank.sldprt"); // A local existing file
fileGet->open(IO_ReadOnly);
httpGet->setHost("192.168.0.6");
QString error = httpGet->errorString();
httpGet->post("/Basistank.sldprt", fileGet);
httpGet->closeConnection();
}
void MainForm::httpDone( bool error ) {
if(error) {
QString error = httpGet->errorString();
}
fileGet->close();
}
|
I have an error in httpDone: "Server closed connection unexpectedly".
Do you think this is wrong with my code?
Regards,
Jean-louis