Interoperability library for script inclusion within titanium desktop sdk >= 1.2.0
FTP-Client
<script type="text/javascript" src="lib/belt.js"></script>
<script type="text/javascript">
// fetch required
Belt('ftp', {
classNamespace: '\\util\\',
classPath: 'ftp.php',
instantiate: false
});
// setup connection credentials
var ftpOptions = {instanceArgs: {
host: 'ftp.host.tld',
user:'user',
pass:'pass'
}};
// create php-obj js-ref through belt
var ftp = Belt("ftp", ftpOptions);
// open connection
ftp.open();
// transfer
ftp.upload("/path/to/local/file", "/path/to/remote/file");
ftp.download("/path/to/remote/file", "/path/to/local/file1");
// close connection
ftp.close();
</script>
Version 0.0.2:
- restricted referencing (see v.0.0.3 kroll re-run)
- not thread-safe
Version 0.0.3
- kroll direct fnc call optimization - w/o turn-around inclusion by step - callback object transformation seems to work now - go "native" > as it's far from optimal right now