romeo umulisa wrote: I am using dreamweaver built in behavior, but also with additional self writing code when needed. |
Dreamweaver's server behaviors don't handle file uploads, and the Insert Record server behavior uses information passed by the $_POST array, whereas the name of your image will be in the $_FILES array.
Although it's possible to edit the Insert Record server behavior code to handle an uploaded file, I think it's probably quicker and easier to hand code it.
// remove any spaces from the file name
$file = str_replace(' ', '_', $_FILES['image']['name']);
// move the file to the upload directory
$success = move_uploaded_file($_FILES['image']['tmp_name'], $uploadDir .'/'. $file);
if ($success) {
// insert the file name into the database
}