Dear All,
I would like to open password protected zip file using QuaZip but it is not working and I can see it says open mode not supported.
File is stored on my local computer.

I can unzip normal file.

Here is my code sample.

Qt Code:
  1. bool CURLScanner::UnZipFile()
  2. {
  3. QuaZip zip(TEST_ZIP_FILE);
  4. //QuaZip zip(FILE_SAVE_PATH);
  5. zip.open(QuaZip::mdUnzip);
  6.  
  7. QuaZipFile file(&zip);
  8. //QString file_password(m_pURLDownloader->GetFileLastUpdatedTime());
  9. QString file_password("1234");
  10.  
  11. for(bool f=zip.goToFirstFile(); f; f=zip.goToNextFile())
  12. {
  13. printf("\n File Found in zip folder : %s", file.getFileName().toUtf8().constData());
  14.  
  15. file.open(QIODevice::ReadOnly,file_password);
  16.  
  17. QByteArray file_data = file.readAll();
  18. QString file_str(file_data);
  19. if(file_str.isEmpty())
  20. {
  21. printf("\n NO FILE CONTENT");
  22. }
  23. else
  24. {
  25. //do something with the data
  26. printf("\n\n UNZIP FILE CONTENT : %s", file_str.toUtf8().constData());
  27.  
  28. // set destination file
  29. QFile dstFile( TEST_UNZIP_FILE );
  30. //QFile dstFile( FILE_SAVE_PATH_2 );
  31.  
  32. // open the destination file
  33. dstFile.open( QIODevice::WriteOnly | QIODevice::Text );
  34. // write the data from the bytes array into the destination file
  35. dstFile.write( file_data.data() );
  36. //close the destination file
  37. dstFile.close();
  38. }
  39.  
  40. file.close();
  41. }
  42.  
  43. zip.close();
  44.  
  45. return true;
  46. }
To copy to clipboard, switch view to plain text mode 

Please help me.
Thanks,