|Jul 12, 2010, 03:34 AM||#1|
i have a url inwhich there's a zip file i wanna unzip. i tried zlib, gzip, NSDataCategory (the methods zlibInflate, gzipInflate) and more..
but without success. i would like please a simple example of converting a zip file (NSData *) to an unzipped file (NSData *).
Thank u very much.
|Jul 12, 2010, 03:55 AM||#2|
What has failed about the approaches you have tried. Post the code that you have tried and explain in each case exactly what failed and where.
|Jul 12, 2010, 04:26 AM||#3|
NSData *zippedFile = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]]; // works well
zippedFile size: 1543 Bytes
unZippedFile should be about 5.5 KB
i imported zlib, gzip, minizip, ZipArchive and NSDataCategory:
NSData *zippedGzipDeflate = [zippedFile gzipDeflate];
NSData *zippedGzipInflate = [zippedFile gzipInflate];
NSData *zippedZlibDeflate = [zippedFile zlibDeflate];
NSData *zippedZlibInflate = [zippedFile zlibInflate];
zippedGzipDeflate.length = 1566 Bytes
zippedGzipInflate.length = 0 Bytes
zippedZlibDeflate.length = 1554 Bytes
zippedZlibInflate.length = 0 Bytes
i also tried ZipArchive: UnzipFileTo, UnzipOpenFile.
i feel like it's right under my nose and i can't find how 2 do it...
|Jul 12, 2010, 04:49 AM||#6|
Edit: Just as a test can you unzip the file correctly with the Mac OSX unzip in The Finder?
|Jul 12, 2010, 04:53 AM||#8|
OK, so it's unlikely to be a problem with the file itself. Are there any messages printed to the console? Do you have the source to the unzip methods you are using? If so step through in the debugger and check what's going on.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Best unzip utility?||MacNoobGuy||Mac Basics and Help||1||Nov 27, 2013 12:32 AM|
|Unzip multiple files into one folder?||DJTaurus||Mac Basics and Help||6||Sep 29, 2013 01:28 AM|
|Error 1—won't unzip a .gz archive's… file.||ThePhantomCampe||OS X||4||Aug 25, 2013 12:32 PM|
|Resolved: UnZip||chattahoochee||MacBook||2||Feb 18, 2013 06:23 PM|
All times are GMT -5. The time now is 08:16 AM.