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 3698186
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:57:03+00:00 2026-05-19T04:57:03+00:00

I searched for unzipping the .zip file which is downloaded in the document directory.

  • 0

I searched for unzipping the .zip file which is downloaded in the document directory. but i found only questions about them and i didnt get any suitable answer which suits my query.

Every one is suggesting to download some api file called “MiniZip” and make use of that. but Its bulky code and that much code is not needed for me. So, it would be greatful for me if i get some less code to unzip the file and make use of it. Its getting downloaded from the url exactly as it was stored but im not getting how to unzip and make use of it in the documents directory. can any one please help me out by giving some sample code or suggesting me..

The following code is the code for downloading my zip file using the url.

-(IBAction)download:(id)sender{

    NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://some url contains .zip file"]  cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];                                                                        
    NSURLConnection  *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

    if (theConnection) {
        // Inform the user that the download failed.
        recievedData=[[NSMutableData data ]retain];

    //  [recievedData writeToFile:path atomically:YES];
        NSLog(@"download ");
    }
    else {
        NSLog(@"download fail");
    }
}


-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{

        [recievedData setLength:0];
    }

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{

    [recievedData appendData:data];
}

- (void)connection:(NSURLConnection *)connection
  didFailWithError:(NSError *)error
{
        [connection release];

    [recievedData release];

    // inform the user
    NSLog(@"Connection failed! Error - %@ %@",
          [error localizedDescription],
          [[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
}



- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    // do something with the data
    // receivedData is declared as a method instance elsewhere
    NSLog(@"Succeeded! Received %d bytes of data",[recievedData length]);

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSString *path=[documentsDirectory stringByAppendingPathComponent:@"books"];
    NSLog(@"value of the path is:%@",path);
    [recievedData writeToFile:[path stringByAppendingPathComponent:@"file"] atomically:YES];

    [connection release];
    [recievedData release];
}   
  • 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-19T04:57:04+00:00Added an answer on May 19, 2026 at 4:57 am

    Does MiniZip present any performance problems to you at all?

    If it doesn’t, then check out objective-zip.

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

Sidebar

Related Questions

Searched a lot about this problem but never found a answer, that solved it.
I searched for this and found Maudite's question about text editors but they were
Searched around on SO for an answer. Found some interesting stuff but I am
I searched, and found this question, which helped me: php static variable is not
i searched around stackoverflow and found out that cookie only can store string not
I searched through a lot of questions on SO but I can't find the
Searched a while but dont know which current WebGL solution supports the most 3d
I searched the internet and found examples for; How to click a button which
I searched the net and handbook, but I only managed to learn what is
I searched SO and found this question , but it's not quite what I'm

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.