prototype File Tree: new connector

Overview

I really want to thank Ben Duffin, who kindly sent me an e-mail with a new connector for the prototype File Tree plugin. This one makes possible to list directories and files from a remote FTP directory.

Download

You can download the new connector with the new v. 1.1 of the plugin (17 January 2009).

Usage

The usage of the connector is really simple. First of all, in the file prototypeFileTreeFTP.php you have to update the variables at lines 33-35 ($ftp_server, $ftp_user and $ftp_pw) with the address of the remote FTP server, the username and its password. The javascript code has to be updated to make it refer to the new connector, passing it a GET variable, isstart, like this:

var startRemoteDir = 'public_html';

$('myElementId').fileTree({
  root: startRemoteDir,
  script: 'prototypeFileTreeFTP.php?isstart='+startRemoteDir,
  folderEvent: 'click',
  loadMessage: 'Loading remote file list...'
}, callbackFunction);

function callbackFunction(file) {
  // My custom code here for file selection
}

Please make use of the new connector and let me know what you think of it. Once again, thank you Ben!