Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikezang

macrumors 6502a
Original poster
May 22, 2010
939
41
Tokyo, Japan
I need to download a zip file and unzip it in my app, what can I do?

Can I use unlha32.dll(unzip library) in my app?
 
Probably not...

I need to download a zip file and unzip it in my app, what can I do?

1 question and 1 suggestion:

  • Question: WHY? Can it be unzipped at the source and downloaded unzipped?
  • Suggestion: I'd start by searching google for open-source unzip code (think about what's in gunzip, for example). Unzipping is much easier than zipping, since all the hard work (the encoding) has already been done. You simply have to do what it says.
Can I use unlha32.dll(unzip library) in my app?

This you probably can't do. DLLs are Window's things, aren't they? There may be a library hiding in the Apple library, but I'm not familiar with that.

Ron C
 
Support for gzip compression is already built into the phone through the zlib(3) library, your app can download a gzipped file and use the zlib library to decompress it. I'm not sure it there's support for ordinary zip files though.

But you should also keep in mind that when you access a file through the web, the web server usually compresses the file on the fly and the client decompresses it. So you might not need to do the compression/decompression yourself.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.