Host a web-app in CompleteFTP
This tutorial will give you two simple examples on how to host web-applications in CompleteFTP.
- From the side-bar menu, select the 'Settings' panel (Professional Edition)
OR select the 'Sites' panel (Enterprise Edition).
- Enable JSS for the site by checking the 'JSS enabled' checkbox in the Site Settings HTTP/HTTPS category.
Enable JSS for the user who is the owner of the folder, into which the JSS file will be placed, as follows:
Select the 'Users' panel from the side-bar menu.
Select the user whose home folder will contain the jss file, e.g. 'JoeSmith'.
Note that the owner of the /Public folder is the user called 'anonymous', which is hidden by default.
To show it, check the 'Show system users/folder/sites' item in the View menu at the bottom left.
- Click the 'Apply changes' button at the top right of the CompleteFTP Manager.
In this example, we create a web-app that simply displays 'Hello world' and is available publicly.
- Create a text file called helloworld.jss with the following content.
- Save it in C:\ProgramData\Enterprise Distributed Technologies\Complete FTP\Public.
- Since 'anonymous' is the owner of /Public, JSS must be enabled for that user, as described above.
- Now navigate to http://localhost/helloworld.jss. A web-page simply saying 'Hello world' will show up.
In this example, we're going to create a .jss file in a user's home directory, and execute it as a JSS
web application. This web-app will be available only to the user.
- Create a file called listFiles.jss with the following content:
response.write("<h1>" + system.user.homeFolder + "</h1>");
var homeFolder = system.getFile(system.user.homeFolder)
var files = homeFolder.getFiles();
- " + file.name + "")
- Save it in JoeSmith's home directory, i.e. C:\ProgramData\Enterprise Distributed Technologies\Complete FTP\Users\JoeSmith.
- Enable JSS for the JoeSmith user, as described above.
- Then go to the URL http://localhost/Home/joesmith/listFiles.jss, where you should see a listing of all the files in that directory.
For more information on developing the JSS web-app, please refer to JSS Web-App Basics and the JSS API Guide.