Build the form page

In this section you will build the NeXTensio list's counterpart - the NeXTensio form. It allows performing all of the actions set as links in the list: insert, update and delete, on a single file or more of them at once. Besides the regular form, you will have to add some features that are file-specific:

  1. The file upload capability - this is used when adding or editing a record, to allow uploading the file, and not only storing its name in the database.

  2. The file delete capability - when a record is deleted, the file it points to should be removed from the disk as well.

To create the form, follow the next steps:

  1. Open the form page in Dreamweaver.

  2. First, add the NeXTensio form components on page. To do so, start the Create NeXTensio Form Wizard from the MX Kollection tab of the Insert panel.

  3. Configure each step of the wizard as follows:

  4. Now the NeXTensio form is on the page, and you can begin to enhance it, in order to work with files: the upload file and delete file options.

  5. First, the upload file capability: this will be implemented using the Upload File trigger. Before applying it, select the file field in the form on page:


     

  6. Now apply the Upload File server behavior from the Server Behaviors tab > MX Kollection > File Upload. Configure each tab of the user interface that opens as follows:

  7. Next, you must add to the existing Delete Transaction (which removes database entries) the capability of removing files from the server as well. This is done in order to maintain the correlation between the database entries and the existing files, and not to have orphan files.

  8. To add this option, simply apply the Delete File server behavior from the Server Behaviors tab > MX Kollection > File Upload. The dialog box that opens should be already filled by the user interface persistence. If not, select the table column storing the file name, and the folder where the files are located. Then click on OK to close the dialog box.

At this point, you have a fully functional file management module at your disposal. So, it's time to save the pages, upload the entire site to the server, and give it a try. In the list, click the Add new button to open the form and add new files. Fill in the form options and add the new record:

 

 

If you need to add more than one file at a time, simply select 3 or 6 in the drop-down next to the Insert button. Or read the How to on changing the number of records you can add at a time. Then simply enter the description and browse for the files in each of the fields. When you click on Insert, all files and records will be added to the server (records into the database, and files are uploaded to the specified folder).