Lets you zip and unzip files.
View the Using Titanium Modules document for instructions on getting started with using this module in your application.
To access this module from JavaScript, you would do the following:
var Compression = require('ti.compression');
Compresses all of the files you pass in "fileArray" to the specified "archiveFile".
Returns the string "success" if the operation succeeded, or an error message if something went wrong.
Extracts the files in the archive file into the destination folder, optionally overriding existing files.
Returns the string "success" if the operation succeeded, or an error message if something went wrong.
To create an archive:
var result = Ti.Compression.zip('test.zip', [ 'a.dat', 'b.dat', 'c.dat' ];
To extract an archive:
var result = Ti.Compression.unzip(Ti.Filesystem.applicationDataDirectory + 'data', 'test.zip', true);
See example for more details.
Android:
iOS:
Create demo files
good compression (no content)
truncate -s 5M file1.dat
Bad compression (random content)
dd if=/dev/urandom of=file1 bs=5M count=1
Clint Tredway
Copyright(c) 2010-present by Axway Appcelerator. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.