close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

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 Ray Borduin | 973 views | 5 replies |

ivanhalen

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

Hallo,
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

Thanks

<?php require_once('Connections/connUploads.php'); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>
<?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";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
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());
}?>
<?php
// 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
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "myfile", "2", "[NewFileName]_[Increment]", "false", $WA_UploadResult1_Params);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<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" />
</form>
</body>
</html>

Sign in to reply to this post

Ray BorduinWebAssist

The standard DW server behaviors only work with form elements and don't work with file fields or server variable bindings directly. You would have to hand edit or use DataAssist to insert or update to the database.

Sign in to reply to this post

ivanhalen

Thank for the answer Ray... I'll ask for a refund, it's the second time that Digital File Pro seems the best solution and then it has some essential task that is missing (the first was with DFP 1.x, if I'm not wrong it had a lack in image manipulation)

What should I do to get a refund?

Sign in to reply to this post

Ray BorduinWebAssist

Email sales@webassist.com, or call our toll free office number and talk to someone in sales for a refund.

This is one of the main reasons why we introduced the Extension Library. The reality is that for one application you often need many of our products. When you get digital file pro we don't know if you want to integrate it into eCart for digital downloads, use it with universal email to email attachments, or use it with dataAssist and manipulate a database.

Our stance used to be that if someone hypothetically might need a single product, we would sell it individually. In the future we will be consolodating products into larger products that encompass all of the functionality needed. We are instead moving to a system where if someone probably needs more than one product we are going to combine them.

The unfortunate side effect is that our products will become more expensive, but the library should help break that barrier. The positive side effect is that people won't have the opportunity to buy the small pieces and find out that they need more to accomplish what they really need.

Over time that means Digital File Pro, Form Builder, DataAssist, Universal Email, and more will all be a single product, but it will obviously cost more than Digital File Pro alone does now, so if you don't want to be a library member, and don't want to spend more it will probably unfortunatly stay out of your price range.

Sign in to reply to this post

ivanhalen

I understand your point of view, and of course I have no blame in WA commercial policy.
Anyway, I think that the missing Insert/Update feature is a big lack in a file upload extension (most WA competitors offer this features in their similar extension, but not all the other bells, whistles and affordability that WA products and support offers: did I mentioned an Holland company? :-D)

I just wanted to insert or update a record and give the user a chance to upload an image or a zip file: no more than this... it's a very common task, and seems that DFP is "below" my needs, while DataAssist is too "over"... I'd appreciate a "middle" extension, but your words tell me that WA policy is going in the opposite direction

It's ok, maybe I'll change my mind but I'm still not ready for a "pay-per-use" solution nor for a "big-pack-all-included" (it's still very clear in my mind the tragic end of Adobe Dreamweaver Developer Toolbox) :-)

Sign in to reply to this post

Ray BorduinWebAssist

There are just too many "middle tier" applications possible to create a separate product for each one. We have created a lot of "bottom tier" options... a framework of extensions. But they can be combined in many hundreds of ways to create different applications. We couldn't possibly create and maintain this many middle tier extensions, so instead we will try to create top tier extensions that may do more than most people need, but will certainly also do everthing that they need.

Good luck with your future endeavors, we appreciate the feedback.

Sign in to reply to this post

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

Content

rating

Layout

rating

Ease of use

rating

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...