iphone - unzip downloaded file through asihttprequest -
I have to realize that using the ASHTPPRCE, we can open the downloaded .zip file or it's only .zzip compressed file Can open
Please do not hesitate to unzip the downloaded file because I can not unzip the ASIHTTPRequest compressed file because I use the third party API like ZipArchive.
Thanks
Support ASIHTPP deccps, for example -
- (IBAction) grabURL: (ID) sender {NSURL * url = [NSURL URLWithString: @ "http : // allseeing -i com "]; ASIHTTPRequest * Request = [ASHTTPR request * with url: url]; // Yes is the default, you can set it to close the gzip compression [request setAllowHelp: Yes]; [Request [synchronous]]; BOOL * Datacecated compressed = [Request fullCompress]; // response was compressed gzip? NSDTA * Compressed Response = [Request RawResponsdata]; // compressed data NSData * uncompressed data = [request response data]; // Uncompressed data NSString * response = [request response string]; // As uncompressed data string) Update: Asi zip file does not support decompress, so I've used it in the past with success . It is very simple and easy to use, supports password protection; many files inside the zip, as well as compresses; Compression removal So you need to bring the zip file through the first asi and then using the zipstop to open it.
The original usage is:
NSString * filepath = [[NSBundle mainBundle] pathForResource: @ "ZIPfileName" type: @ "zip"]; ZipRaki * ZIPArchive = [[ZIPArchive Elok] Init]; [ZIPArchive Angeip Openfile: filepath password: @ "xxxxxx"]; [ZIPArchive UnzipFileTo: {pathToDirectory} Overwrite: Yes]; [ZIPArchive UnzipCloseFile]; [ZIPArchive Release];
Comments
Post a Comment