1

I'm trying to open a password protected ZIP file using QuaZIP in Qt but it isn't working. It works nicely if I remove password protection from the zip file. Here's my code

QuaZip zip("/media/ferhan/Education_material_and_setups/compressiontest/test.zip");
zip.open(QuaZip::mdUnzip);
QuaZipFile file(&zip);
for(bool f=zip.goToFirstFile(); f; f=zip.goToNextFile()) {
    file.open(QIODevice::ReadOnly, "password");
    if(!file.isOpen())
    {
        qDebug()<<"Error : "<<file.getZipError()<<endl ;
    }
    else
    {
        qDebug()<<"File is open!"<<endl;
        file.close();
    }
}
zip.close();

The error string shows error code 103. I tried to search for this error code but found nothing.

Some info about my ZIP file

7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,4 CPUs) Processing archive: /media/ferhan/Education_material_and_setups/compressiontest/test.zip Testing drunk.jpg Testing monday-motivate-11.jpg Testing very-clever-25.jpg Everything is Ok Files: 3 Size: 90350 Compressed: 89128

Can anybody help?

Farhan Haider
  • 1,244
  • 1
  • 13
  • 22

0 Answers0