3

I use Objective-zip to zip some files with password and generate the zip file successfully. However, when I upzip the file manually, it said that my password is wrong, is there any way to deal with it? does it cause by crc32 or other thing?

-(void) zipCandidcate:(NSString *)filePath Candidcate:(Candicate *)c{

ZipFile *zFile=[[ZipFile alloc] initWithFileName:filePath  mode:ZipFileModeCreate ];

    //write folder
    NSString *cFolderPath=[c filePath];


    //write photo
    NSString *cPhotoPath=[[[c photos] objectAtIndex:0] path];
    ws=[zFile writeFileInZipWithName:@"file/image-1.png" fileDate:[[NSDate alloc] init] compressionLevel:ZipCompressionLevelNone password:@"123" crc32:0];
    [ws writeData:[[NSFileManager defaultManager] contentsAtPath:cPhotoPath]];
    [ws finishedWriting];

     ws=[zFile writeFileInZipWithName:@"file/" compressionLevel:ZipCompressionLevelNone];
    [ws writeData:[[NSFileManager defaultManager] contentsAtPath:filePath]];
    [ws finishedWriting];

[zFile close];

}

user2557508
  • 31
  • 1
  • 2
  • Check the following answer: [Objective Zip Password & CRC][1] [1]: http://stackoverflow.com/a/28939471/305250 – Matt Mar 09 '15 at 10:21

0 Answers0