In this 'how to' tutorial you will learn how to use NeXTensio and MX File Upload to update records that have associated images. You will create a NeXTensio list displaying details regarding an online shop's products, and a NeXTensio form that will allow modifying product information.
Each product has an associated image, and the NeXTensio form will have to:
Upload the specified image when a new product is added.
Keep the old image when the product details are updated, if no new image is specified.
On product update, if a new image is selected, replace the old one both on the disk and in the database.
On product update, if a Delete image checkbox is selected, the image must be removed from the disk and from the database.
When a record is deleted, its image must be removed as well.
The database used for this tutorial only contains one table, storing
product information:

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.
The table columns are:
id_prd - stores the primary key; it is used to uniquely identify each record.
name_prd - stores the product name.
description_prd - stores a short description about the product.
image_prd - stores the name of the product picture.
price_prd - the product price.
To quickly create a similar database structure you can use the .sql or .mdb database scripts that can be found inside the downloaded package, in the \tutorials\How_to\Update records with images\db\.
For the tutorial you will need two files: one will contain the list of products (index) and one the form (form). After having defined your Dreamweaver site, create the index file. The form file will be automatically created by the Create NeXTensio List Wizard.
You also need to define a Dreamweaver
database connection to retrieve product information. Open the site index you've created earlier and define a new database
connection. Set it to point to the database where you created the table
above (replace the settings in the image below with your actual settings):

To complete this tutorial you need to have the following extensions installed:
NeXTensio
MX File Upload
The completion time for this tutorial is of approximately 30 minutes, depending on your authoring knowledge with Dreamweaver and MX Kollection 3.