View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Does this works with standard DW Insert and Update server behaviors?

Thread began 12/08/2009 11:22 am by ivanhalen | Last modified 12/08/2009 4:18 pm by ivanhalen | 878 views | 5 replies


Does this works with standard DW Insert and Update server behaviors?

I just purchased Digital File Pro 2 and I was trying to make it work with Insert Record behavior provided by Dreamweaver
All I get is a "Notice: Undefined index: myfile in D:\Web\php\upload.php on line 43"
The file is uploaded but the filename is not stored in the database and I get that error

Is there something I am missing?
I attach the code


<?php require_once('Connections/connUploads.php'); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
return $theValue;

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO uploads (name, upload) VALUES (%s, %s)",
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['myfile'], "text"));

mysql_select_db($database_connUploads, $connUploads);
$Result1 = mysql_query($insertSQL, $connUploads) or die(mysql_error());
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "public/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
WA_DFP_UploadFiles("WA_UploadResult1", "myfile", "2", "[NewFileName]_[Increment]", "false", $WA_UploadResult1_Params);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1" id="form1">
<input type="text" name="name" id="name" />
<input type="file" name="myfile" id="myfile" />
<input type="submit" name="invia" id="invia" value="Submit" />
<input type="hidden" name="MM_insert" value="form1" />

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...