How to write a JSS extension

A JSS Extension is an extension written in JSS (Javascript Server-Side).

Three types of JSS extensions are supported:

Note that this feature is only available in the Enterprise Edition.

Creating a JSS extension

To create a CompleteFTP JSS extension:

  1. Open CompleteFTP Manager.
  2. Select the Extensions panel then select the Extensions tab.
  3. Click 'Add extension'.
  4. Select 'Javascript (JSS) extension'.
  5. Select extension type. (e.g. 'Authentication').
  6. Enter the code for your extension. You can write it in CompleteFTP's syntax-highlighting editor or any of your favourite Javascript editors then add this JSS file to CompleteFTP editor by 'File/Open from/File on server...'.
  7. Click the Apply Changes button.
  8. Select Permissions tab and grant permission for groups or users to use this extension.
  9. Click the Apply Changes button.
  10. Test your JSS Extension by using an FTP client.

Note: Full details of JSS API are provided in the JSS API Reference.

Registration of JSS extensions

JSS extensions must be registered in order for them to take effect. This is done automatically for authentication and file-system extensions when they are created, but it must be done manually for custom-command extensions. Each type of JSS extensions has its own method of registration:

Authentication extensions

Custom authenticators will only be used if they're enabled in the 'Other authentication methods' list in General User Settings in the Users panel.

Custom Command extensions

Only users who have permission for a particular custom command extension may invoke the commands that it defines. Permission may be granted to individual users or groups in the Permission tab in the Extensions panel.

File-System extensions

Folders that use a custom file-system extension may only be created if they have a folder-type defined for them. This is done in the Folder Types tab of the Extensions panel.

Saving a JSS extension

For the JSS code in CompleteFTP's editor, you can save it by choosing 'File/Save to/File on server...' then choose where to save the file and name the file. After that, the file can be loaded by 'File/Open from/File on server...'.

For a quick save after editing, you can use 'File/Save [Ctrl+S]' or just click on Apply Changes.