uploading files to HTTP!!
Hi all,
I have written a small app to connect to a HTTP server and transffer files via HTTP post. It
actually should upload jpeg files to http set-up.
here is the code I have written,
Code:
{
http->setHost(url.host(), 80);
int filesize = putFile->size();
header.setValue("enctype","multipart/form-data");
header.setValue("Host", url.host());
header.setValue("Content-type","image/jpeg");
header.setValue("Connection", "keep-alive");
header.
setValue("Size",
QString::number(filesize
));
header.setContentType("image/jpeg");
header.setContentLength(filesize);
http->request(header, putFile);
}
Iam filling in all the data to the request header and sending it to http request. But I am getting error 5: Internal server error. Am I doing some thing wrong here?
Thanks,
Raajesh
Re: uploading files to HTTP!!
Hi,
I believe you will have a better experience developing what you want, using ftp. So you will have more possibilities.
Marcelo Geyer
Brazil.
Re: uploading files to HTTP!!
Quote:
Originally Posted by
Raajesh
header.setValue("enctype","multipart/form-data");
Are you sure this is correct and matches the way you send data?