HI there all, I'm hoping someone can give me some pointers on how to transfer a file via the KIO::http_post method. I have the following code:
|
Source code
|
1
2
3
4
5
6
7
8
|
static char bindata[] = "uname='fred'&password='secret'";
QByteArray postByteData;
postByteData.setRawData(bindata, sizeof(bindata) );
KURL dest_URL = KURL("http://www.target.com/upload.php");
KIO::TransferJob* job = KIO::http_post( dest_URL, postByteData, false ); // return * KIO::Transfer
job->addMetaData("content-type:", "Content-Type: application/x-www-form-urlencoded" );
|
and what I want to do is also include an image file. Presumably I need to set an appropraite mime type, I'm just not sure which one and then how to encode and include the file. I havent had much luck finding documentation on how browsers normally encode this when files are POSTed using the
|
Source code
|
1
|
<input type='file'>
|
tag and I'm not sure how I would achive this using http_post.
Has anyone done something similar and could give me a few pointers?