zip , AS3Commons Zip ( FZip). Adler32, .
, zip-. , URLLoader zip Event.COMPLETE:
import org.as3commons.zip.Zip;
import org.as3commons.zip.ZipFile;
private function _onZipDownloaded(e:Event):void {
var ba:ByteArray = ByteArray(e.target.data);
var zip:Zip = new Zip();
zip.loadBytes(ba);
for(var i:uint = 0; i < zip.getFileCount(); i++) {
var zipFile:ZipFile = zip.getFileAt(i);
var extracted:File = directory.resolvePath(zipFile.filename);
var fs:FileStream = new FileStream();
fs.open(extracted, FileMode.WRITE);
fs.writeBytes(zipFile.content);
fs.close();
}
}
, , ...