Unsolved QuaZip Unzip Trouble
-
Hello everyone.
I have the folowing code to unzip a .zip file with some (.exe .txt .pdf)
But the only file that can be read after unzip is the txt file.
The others files can't be opened (.pdf .exe) and it file size is wrongfor (bool more = zip.goToFirstFile(); more; more = zip.goToNextFile()) {
QString filePath = zip.getCurrentFileName();
QuaZipFile zFile(zip.getZipName(), filePath);
zFile.open(QIODevice::ReadOnly);
QByteArray ba = zFile.readAll();
zFile.close();
QFile dstFile("C:/" + filePath);
dstFile.open(QIODevice::WriteOnly | QIODevice::Text);
dstFile.write(ba.data());
dstFile.close();
} -
Hi
Try look for TextStreams and other class that might convert input :) -
Solve the problem loading the data is this way.
QDataStream out(&dstFile);
out.writeRawData(ba.data(), ba.size());And works like a charm!
Thank you!