racinglocura07
17th June 2010, 19:46
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:
QString data;
QFile file(filename);
file.open(QIODevice::ReadOnly | QIODevice::Text);
while (!file.atEnd())
{
QByteArray line = file.readLine();
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
I want to send a pdf by mail so i have to encode it to base64
When i do this:
QString data;
QFile file(filename);
file.open(QIODevice::ReadOnly | QIODevice::Text);
while (!file.atEnd())
{
QByteArray line = file.readLine();
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