JSS Web-Apps

CompleteFTP (Professional and Enterprise MFT) includes everything you need to host your own web-apps written in Javascript (JSS).

Creating a custom web-app for CompleteFTP's HTTP server offers numerous benefits to users. A tailored web-app can enhance the user experience when accessing files, reduce administrative tasks and enable integration with external systems. By leveraging the power of JSS and the available APIs, users can create web-apps that cater to their specific needs and workflows, such as advanced file searches, custom reporting, or automated file operations. Furthermore, a well-designed web-app can seamlessly integrate with other systems or services, enabling greater interoperability and expanding the capabilities of CompleteFTP beyond its core file-server functionality. Writing a custom web-app empowers users to take full advantage of CompleteFTP's HTTP server, allowing for a more personalized and effective solution to their file management and server administration needs.

Examples

  1. Custom file management interface: Develop a web-app that offers a bespoke file management interface, tailored to the organization's branding and workflow requirements. This can include customized navigation, file previews, or specific file sorting options. Start with the source-code CompleteFTP's existing file-manager (available to users upon request), or write your own.
  2. Access control and user management: Create a web-app to simplify and streamline user management, including permissions and access control. This can include group-based permissions, department-specific restrictions, or time-limited access to certain resources.
  3. File approval and review process: Implement a web-app that facilitates a document approval and review workflow, enabling users to submit files for review, track changes, and receive approval notifications.
  4. Automated file processing: Develop a web-app that automates specific file processing tasks, such as resizing images, converting file formats, or extracting metadata for indexing and searching purposes.
  5. Advanced search capabilities: Implement a web-app that offers advanced file search capabilities, enabling users to locate files based on metadata, content, or custom-defined criteria.
  6. Integration with third-party services: Develop a web-app that integrates the file server with other systems or services, such as CRM, ERP, or project management tools, to improve overall organizational efficiency and collaboration. This can be combines with CompleteFTP's custom JSS process triggers to create a powerful solution.
  7. Custom notifications and alerts: Create a web-app combines with JSS process triggers to manage custom notifications and alerts.
  8. Secure file sharing: Implement a web-app that enhances CompleteFTP's existing secure file sharing experience.
  9. Data backup and archiving: Develop a web-app that automates data backup and archiving processes, ensuring that critical files are securely stored and easily retrievable in case of data loss or system failure.

JSS Web Services

JSS web-apps can also be utilized as web APIs or services that can be called from other software, providing a versatile way to extend the functionality of CompleteFTP's HTTP server. By creating server-side JavaScript applications that expose custom APIs, organizations can integrate CompleteFTP with other systems and services, facilitating seamless data exchange and improving overall efficiency.

Examples

Using JSS web-apps as web APIs or services enables organizations to:

  1. Automate file operations: Develop an API that allows external systems to upload, download, or manipulate files on the CompleteFTP server programmatically. For example, an organization's content management system (CMS) can automatically push new assets to the file server or retrieve files for processing.
  2. Remote user management: Create a web API that allows external applications to manage user accounts and access permissions, enabling seamless integration with identity management systems or HR tools.
  3. Custom data validation: Implement a web service that validates uploaded files based on custom criteria, such as file format, size, or content. This can be useful for ensuring data quality and compliance with organizational policies.
  4. File metadata extraction: Develop a web API that extracts metadata from uploaded files and sends it to external systems for indexing, searching, or analysis.
  5. Secure data exchange: Implement a web API that facilitates secure data exchange between the file server and external partners or clients. This can include encrypting data, generating secure tokens, or implementing OAuth for authentication.

Instructions:

To add a JSS web-app extension, follow these steps:

  1. Open CompleteFTP Manager and navigate to the Extensions panel.
  2. Select the 'Web-apps' tab and click 'Add web-app'.
  3. Add Web App
  4. In the dialog, enter the name and select a folder for the web-app.
  5. Add Web App Dialog
  6. If you need to create a new folder, select the option to do so. The folder must be a Windows folder, so all other folder types are disabled.
  7. Click OK to create the web-app.
  8. You will be prompted to choose whether the web-app should be accessible to non-authenticated users. Click Yes or No, as needed.
  9. After clicking Yes or No, the web-app will be created. If the folder you chose or created does not contain an index.html or index.jss file, a simple web-app with index.jss and template.html files will be created in the folder. Note that the path of a web-app can't be beneath another web-app.
  10. A message box displaying the URL of the web-app will appear. Click OK to close the message box.
  11. Web App URL
  12. Click Apply changes in the main window.
  13. Now you can open the web-app in a browser using the URL.

Developing JSS Web-Apps

The sample web-app that's generated by CompleteFTP consists of two files index.jss and template.html

index.jss:

function processRequest() {
	var data = {
		siteName: system.site.label
	};
	response.writeUsingTemplateFile("template.html", data);
}

template.html:

<html>
<body>
	<h1>Welcome to {{siteName}}</h1>
</body>
</html>

You can edit these files to start building your own web-apps. To start learning please continue to the JSS Web-App Basics topic.

Understanding .jss file execution

While .jss files are executed by default, it is possible to configure CompleteFTP such that they don't get executed. We therefore explain how to control .jss file execution in this section.

A file with a .jss extension will be run as JSS if:

  1. JSS is enabled on the site serving up the page, AND
  2. JSS is enabled for the either:
    1. the logged in user, OR
    2. user who owns the folder that contains the file

If these conditions are not satisfied then the file will be served up the same as an non-JSS file.

JSS is enabled for a site by checking the JSS enabled checkbox in the Site Settings category, HTTP/HTTPS -> Server-side Javascript (JSS):

JSS enabled - Site

JSS is enabled for a user by checking the JSS (Server-side Javascript) checkbox in the Site Properties category, Scripting and Shells:

Jss enabled - User

Note that for JSS web-apps to be available to unauthenticated users, JSS must be enabled for the owner of the /Public folder, i.e. anonymous, which it isn't by default.

For more information on how to host a web-app in CompleteFTP, please refer to Step-by-step guide: Host a web-app in CompleteFTP .