Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6959609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:17:39+00:00 2026-05-27T15:17:39+00:00

I need to zip a subdirectory of my Documents folder in an iOS app.

  • 0

I need to zip a subdirectory of my Documents folder in an iOS app. After consulting Google and other SO posts, I’ve found ZipKit and ZipArchive as two open source projects offering this functionality. At this point, I’ve chosen to implement ZipKit, as it seems to be much more currently maintained than ZipArchive.

I’ve found examples of how to unzip archives, but haven’t been able to find an example of how to archive a directory into a .zip file. I have tried the following code, which returned a successful result status, but no zip file was actually generated.

// projectPath is /Documents/projects/myproject
ZKDataArchive *archive = [[ZKDataArchive alloc] init];
NSInteger result = [archive deflateDirectory:projectPath relativeToPath:nil usingResourceFork:NO];

I’m sure there’s something basic I’m not doing correctly, but haven’t been able to sort out what it is. In particular, I haven’t yet figured out the meaning of each parameter to deflateDirectory:.

If anyone can point me in the right direction (or has other recommendations for zipping directories on iOS) I would greatly appreciate it.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:17:40+00:00Added an answer on May 27, 2026 at 3:17 pm

    Success. Here’s the scoop for anyone else:

    Let’s say we want to zip /Documents/myfolder

    NSString *zipFilePath = @"/Documents/zipped.zip";
    ZKFileArchive *archive = [ZKFileArchive archiveWithArchivePath:zipFilePath];
    NSInteger result = [archive deflateDirectory:@"/Documents/myfolder" relativeToPath:@"/Documents" usingResourceFork:NO];
    

    And the zip file is created!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to (un)zip some files and after some googling I haven't found any
I need to download images from other websites to my server. Create a ZIP
How can I download and unpack ZIP file to extension folder? Need to update
I need to zip a file in the folder c:\projects\test\test.log I need to zip
I need to zip a folder that containts an .xml file and a .fgdb
I need to do buildout google app engine. I wrote config file buildout.cfg: [buildout]
I need to extract the zip code from a string. The string looks like
I need to compress files in [*.zip] format in .NET 1.1. I don't want
I need to programatically encrypt a directory of files, like in a .zip or
i have a php script where i need to create a zip archive with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.