Copy link to clipboard
Copied
Dear,
I am looking for some help on how to record information about an uploaded file in a database table. I want to create a upload directory in my site root, and have just the information of the uploaded file into my database (have in tabe, image_x.pnp and so on) the image_x.png represents the file that was uploaded,
thank you all,
romeo
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 t
Copy link to clipboard
Copied
Is this question related to the former Adobe Dreamweaver Developer Toolbox (ADDT) extension, or are you using Dreamweaver´s built-in server behaviours ?
Cheers,
Günter
Copy link to clipboard
Copied
I am using dreamweaver built in behavior, but also with additional self writing code when needed.
R.
Copy link to clipboard
Copied
that´s why I´ll be moving this thread to the regular Dreamweaver Application Development forum ;-).
Copy link to clipboard
Copied
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
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now