ZipFile Ti Module for iOS
Steps to download and install zipfile module:
- download zipfile module from http://kosso.co.uk/stuff/zipfile-iphone-0.1.21.zip
- unzip and place into /Library/Application Support/Titatnium/modules/, like this ~/modules/iphone/zipfile/0.1.21/...
- Edit tiapp.xml to include the module:
<modules><module version="0.1.21">zipfilemodule>
modules>
- restart Titanium Studio and remove build folder.
var zipfile = require("zipfile");
zipfile.extract(zipFileLocation, unzipFileLocation);
where zipFileLocation = /User/...Library/......
Note:
Since 1.7.0 the Filesystem has been changed to return a localhost url ('file://localhost/User/...') for properties such as applicationDataDirectory.
While zipfile only work on native file path without the prefix 'file://localhost'.
var dataDir = Ti.Filesystem.applicationDataDirectory.slice(0,Ti.Filesystem.applicationDataDirectory.length - 1).replace('file://localhost','').replace(/%20/g,' ');
dataDir = dataDir + '/../Library/Caches/';
Module development guide
https://wiki.appcelerator.org/display/guides/iOS+Module+Development+Guide#iOSModuleDevelopmentGuide-TestingyourModule
ZipFile Ti Module for Android
Titanium official module:
websiteburo's androzip:
沒有留言:
張貼留言