Posts Tagged ‘zip’

ZipFileReader class can NOT make directory or file.
So you should make directory or file according to ZipEntry.isDirectory() method.

var file:File = File.desktopDirectory.resolvePath("");
var reader:ZipFileReader = new ZipFileReader();;
var fileList:Array = reader.getEntries();
var baseDir:File = File.documentsDirectory();

for each(var entry:ZipEntry in fileList){
	var filename:String = entry.getFilename();
		//  If entry is directory 
		var dir:File = baseDir.resolvePath(filename);
		var unzippedBytes:ByteArray = reader.unzip(entry);
		var file:File = baseDir.resolvePath(filename);
		var fs:FileStream = new FileStream(FileMode.WRITE);

var zipReader:ZipFileReader = new ZipFileReader();
var entries:Array = zipReader.getEntries();
for(var i:int = 0; i

I made air app that it convert o’reilly ebook app file to epub file.

STEP1 ) Buy o’reilly ebooks from Android market.

If ebook app support to export epub format, please use it. But some app doesn’t support ….

ex) Flex4 Cookbook, and etc ….

Then Go on the Next Step….

STEP2 ) copy to sdcard from apk file using appMonster or other app…..

STEP3 ) mount android to PC using USB cable.

STEP4 ) Install “export epub” app and execute it.

STEP5 ) Drag and drop to the following image. Then wait a minute.
Screen shows “DONE” label. Then you can find epub file in the same directory.

I don’t know the app can extract epub file from iPhone app because I don’t have mac and iphone.
This air application use airxzip library.
airxzip library is as3 zip library for Adobe AIR.

The last time I introduced the features of “Airxzip”, this post says one of the features.

Change file system and set filemode and directory mode

var writer:ZipFileWriter = new ZipFileWriter(ZipFileWriter.HOST_UNIX);""));


unzip -Z 
Archive:   1550668 bytes   3 files
drwx------  1.0 unx        0 b- stor  6-May-10 20:11 Foo1/
-rwx------  2.0 unx   777835 b- defN 14-Jul-09 14:32 Foo2/image.jpg
-rwxrw-rw-  2.0 unx   777835 b- defN 14-Jul-09 14:32 Foo3/image.jpg

Default filetype is “ZipFileWriter.HOST_WIN”.
So If you want to create zip file for Mac or Unix/Linux , Please set “ZipFileWriter.HOST_UNIX”.

var writer:ZipFileWriter = new ZipFileWriter(ZipFileWriter.HOST_UNIX);

Default file system

 unzip -Z 
Archive:   775492 bytes   3 files
-rw-a--     2.0 fat        6 b- defN  6-May-10 20:12 sample.txt
drwx---     1.0 fat        0 b- stor  6-May-10 20:12 Foo1/
-rw-a--     2.0 fat   777835 b- defN 14-Jul-09 14:32 Foo1/image.jpg


Airxzip is a library in ActionScript3 (AIR).
Fzip is ActionScript3 library too.
But I have some problems to use it.
So I made “Airxzip”.

Airxzip has following features …

1) Specialize in AIR
It becomes possible for the access to begin at the end of the file ( zip entry infomations ),
It does not to depend on the size of zip file.
So It is able to access information quickly.

2) Async upzip
Airxzip has 2 unzip method. ( unzip() and unzipAsync() )

3) PKWare encrypt/decrypt

4) File attribute ( Zip mode only)
Enable to set file attirbute.
ex) “0700” “0755”

5) Japanese filename
Mac OS and Unix filename is UTF-8, Windows is Shift_JIS.
And Mac OS UTF-8 and Unix UTF-8 is not same to handle Hankaku-kana.
So AIrxzip resolve these difference automatically.

Project Site

Google Code

Sample codes


Add to Google
« 2月