So, I need to do just that. I see there's QMimeData class out there, I can create mime data with it, but I see no way to extract it as plain data (as in QByteArray), to send it in HTTP POST request. Please point me in the right direction
So, I need to do just that. I see there's QMimeData class out there, I can create mime data with it, but I see no way to extract it as plain data (as in QByteArray), to send it in HTTP POST request. Please point me in the right direction
You can't do that directly. But if you call QByteArray::toBase64() you get a string of ascii characters that can be sent.
Bo Thorsen, Viking Software
Qt applications on Linux and Windows
Septi (2nd December 2010)
I see... But AFAIK, the base64-coded data isn't all I need. Do you know any library I could use to write MIME?
You don't need any library. mime-type only informs the other end of communication what kind of data is being sent. Then you just send the actual data in the format you declared with the mime-type. "MIME" is not any kind of special format on its own. If you have a png image then its mime-type is image/png, if you have an mp3 file then its mime-type is audio/mp3, if you have custom binary data then the mime-type is application/octet-stream, simple text is text/plain, etc. You declare the type of the data and not convert the data to the mime type.
Bookmarks