Problems Encoding to Base64
I am having problems encoding a file to base64.
I want to send a pdf by mail so i have to encode it to base64
When i do this:
Code:
while (!file.atEnd())
{
data += line.toBase64();
}
The string data seems to content all the information, but if i attached it into a mail i could not open the file
I hope you could help me
Sorry for my bad english
Re: Problems Encoding to Base64
You have to encode the whole string at once, not line by line.
Re: Problems Encoding to Base64
Secondly, is your MIME header correct?
Re: Problems Encoding to Base64
i have also tried readAll();
But the result was the same...
Yes the MIME is correct!
Re: Problems Encoding to Base64
Then either post the complete code you use for generating the email, or post the generated email (as an attachment)
Re: Problems Encoding to Base64
I encounter the same problem.
I need to fill the postfields with base64 encoded.
Code:
QFile sourceFile
(filename
);
But the web site doesn't recognize the base64 string.
Re: Problems Encoding to Base64
What do you do with the encoded string?