Unzipping a single file from Archive

前端 未结 1 1919
独厮守ぢ
独厮守ぢ 2021-01-24 11:44

I\'m trying to port an existing Android application to iOS, In the Android application i was using a ZipInputStream to extract a single file from the zip archive and store it in

相关标签:
1条回答
  • 2021-01-24 12:11

    I just found the answer,

    I had to modify SSZipArchive to insert a method that will extract a single file from the ZIP archive (Based on its name)

    You could find the modified version here, if someone finds this useful i might clean it up, add the delegate, the tests and propose for pull in SSZipArchive.

    Usage is straightforward:

    NSString *zipEntityToExtract = @"example.aac";
    NSString *destinationFilePath = ...; //(Includes filename)
    NSString *zipPath = ...;
    [SSZipArchive unzipEntityName:zipEntityToExtract fromFilePath:zipPath toDestination:filePath];
    //File is now in destinationFilePath
    
    0 讨论(0)
提交回复
热议问题