How to build a file management module

In this 'how to' tutorial you will learn how to use NeXTensio to build a complete file management system that allows you to list, download and upload single and multiple files. You can use the pages you will create next to ease managing the files (.pdf documents etc.) on your site.

For the purpose of this tutorial, a simple database structure will be used, containing only one table, with the structure similar to the image below:

 

Note: The database diagram in the image above was built with MX Query Builder (also referred as QuB) to better illustrate the database structure. You do not need to build it in order to complete this 'how to' tutorial.

 

In the \tutorials\_HOW_TO\File management\db\ zip package, sql and mdb scripts can be found. In order to create the table, simply import them into an existing (or new) database, using the database management software of choice.

 

In this tutorial you will create two files:

 

 

You can easily create this file structure by unpacking the zip file corresponding to your server model from \tutorials\_HOW_TO\File management\ in your site root.

Besides the files that you need to create, some files and folders will be automatically added by Dreamweaver and NeXTensio. These are files that are required in order for features to work (e.g. the Connection folder, which stores the Dreamweaver database connection, or the includes folder which stores files required by NeXTensio).

Before starting to work on the site contents, you must first define a Dreamweaver database connection. To do so, open one of the site pages, and create a new connection by clicking on the Plus (+) button of the Databases tab. Configure the dialog box to use the database server and database name you have:
 


 

Next, you will create the NeXTensio list that displays the files, and also allows downloading them.

Contents

Build the file list

Build the form page

Show only files that exist on the server