close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error message - new version won't upload image file

Thread began 7/13/2010 5:38 pm by LWag48648773 | Last modified 7/15/2010 5:38 pm by Jason Byrnes | 3397 views | 9 replies |

LWag48648773

Error message - new version won't upload image file

Can you tell me why I keep getting this message?

The Upload Files_WA script does not define the findServerBehaviors function.

Since I downloaded the latest version, I have not been able to get the image file to upload. I have been working on this about 20 hours. Everything is working except the file is not uploading. I mean my code is ok, the path is good.

I have this working on another site and I checked that database compared to this and they appear to be setup identical. They are also on the same server.

Is it something with the newer version? The field is a Long Blob. I even added the code that was suggested to someone else in this forum.
<?php
ini_set('memory_limit','500M');
?>

I'd really like to get this work. Any advice?

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

for the error message you are getting, try deleting the Dreamweaver cache file from the users configuration folder:
common_installation_issues.pdf

Please send a copy of the upload page so i can examine the code to determine what the problem may be.

Sign in to reply to this post

LWag48648773

I have attached a screenshot of the database with a few items I entered. As you can see, the blog is showing a value so it knows something should be there. Also, if I tell it to upload an image that is already in the CatImages folder, the image will display. Obviously it is not uploading it but the code is correct because it knows where to find the image. Notice the item in the middle of the ones with the goofy names. The description field says 'this one was in the folder'.
The image field is a Longblog in the database. I have everything set just like the database for the other web site where I am using this. I removed some of the table rows in the code to make this file smaller.

I also deleted the file as instructed in your last message.

Thank you,
Laura

Attached Files
imageUploadProblems.pdf
Sign in to reply to this post

Jason ByrnesWebAssist

Digital File pro does not support storing the image into a blob field.


With digital file pro, you can upload the file to a folder on the server, then store the file name in a text column in the database, but it does not support storing the image itself in a blob field of the database.

Sign in to reply to this post

LWag48648773

I have a longblog in my other database that works just with DFP. I changed it to text and the code is working and the database is recognizing all my images, but still no files are actually uploading to the server.
I realized I forgot to send you the code.
<?php require_once("Connections/connFay.php"); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Logged in to Admin")){
WA_Auth_RestrictAccess("Admin_LogIn.php");
}
?>
<?php
ini_set('memory_limit','500M');
?>
<?php
// WA_UploadResult2 Params Start
$WA_UploadResult2_Params = array();
// WA_UploadResult2_1 Start
$WA_UploadResult2_Params["WA_UploadResult2_1"] = array(
'UploadFolder' => "CatImages/",
'FileName' => "".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."",
'DefaultFileName' => "",
'ResizeType' => "2",
'ResizeWidth' => "250",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult2", "Image", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult2_Params);
}
?>
<?php

// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $connFay;
$WA_table = "Catalog";
$WA_sessionName = "WADA_Insert_Catalog";
$WA_redirectURL = "Catalog_Insert.php";
$WA_keepQueryString = false;
$WA_indexField = "ItemID";
$WA_fieldNamesStr = "CatalogID|ItemName|Description|Price|Age|Category|Image";
$WA_fieldValuesStr = "".((isset($_POST["CatalogID"]))?$_POST["CatalogID"]:"") ."" . "|" . "".((isset($_POST["ItemName"]))?$_POST["ItemName"]:"") ."" . "|" . "".((isset($_POST["Description"]))?$_POST["Description"]:"") ."" . "|" . "".((isset($_POST["Price"]))?$_POST["Price"]:"") ."" . "|" . "".((isset($_POST["Age"]))?$_POST["Age"]:"") ."" . "|" . "".((isset($_POST["Category"]))?$_POST["Category"]:"") ."" . "|" . "".((isset($_POST["Image"]))?$_POST["Image"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_connFay;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<!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>Insert Catalog</title>
<link href="WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="WADAInsertContainer">
<form action="Catalog_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">
<div class="WADAHeader"><h1 align="center">Insert Record</h1></div>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">CatalogID:</th>
<td class="WADADataTableCell"><input type="text" name="CatalogID" id="CatalogID" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ItemName:</th>
<td class="WADADataTableCell"><input type="text" name="ItemName" id="ItemName" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Description:</th>
<td class="WADADataTableCell"><input type="text" name="Description" id="Description" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Price:</th>
<td class="WADADataTableCell"><input type="text" name="Price" id="Price" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Age:</th>
<td class="WADADataTableCell"><input type="text" name="Age" id="Age" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Category:</th>
<td class="WADADataTableCell"><select name="Category" id="Category" value="" size="1" />
<option> </option>
<option>Active Play</option>
<option>Arts & Crafts</option>
<option>Calico Critters</option>
<option>Construction</option>
<option>Corolle Dolls</option>
<option>Games</option>
<option>Gears</option>
<option>Infants</option>
<option>Music</option>
<option>Play Mobile</option>
<option>Pretend Play</option>
<option>Puzzles</option>
<option>Science</option></td>
</tr>
<tr>
<th class="WADADataTableHeader">Image:</th>
<td class="WADADataTableCell"><input type="file" name="Image" id="Image" value="" size="32" /></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="WA_DataAssist/images/Pacifica/Refined_insert.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="Catalog_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="WA_DataAssist/images/Pacifica/Refined_cancel.gif" /></a></td>
</tr>
<tr>
<td><h2 align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Catalog_Search.php">Go to Search Page</a></h2></td></tr>
</table>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />
</div>
</form>
</div>
</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

the code for the file name is not correct

change:
'FileName' => "".$WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"] ."",

to;
'FileName' => "[FileName]",

also, in the insert record behavior, you must bind the file column to the WA Uploaded Files (File Field Name) -> Server File Name binding instead of the Form binding group that you are currctly using.

Also, for file uplaod to function, your form must be set to use the multipart/form-data encoding type.

Change:
<form action="Catalog_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">

to:
<form action="Catalog_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm" enctype="multipart/form-data">

Sign in to reply to this post

LWag48648773

I realize that I have been messing with this for so long that I have changed things from wrong to right to back to wrong. I had a couple of those things right at one point and didn't realize I had messed them up. What I had failed to realize is the extra code should go in the file field but that is because it's not that way in my other form. I don't understand how my other form is working properly.

I think I did all you said. I NOW have the image uploading but somehow I messed something else up because the info is not going into the database field. The image field is blank so therefore, no image show up on the page. Please check my code again to make sure I have this correct. I only changed the database to make the image field a text rather than a blob. This shouldn't be this difficult!! :-)

thank you!

<?php require_once("Connections/connFay.php"); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Logged in to Admin")){
WA_Auth_RestrictAccess("Admin_LogIn.php");
}
?>
<?php
ini_set('memory_limit','500M');
?>
<?php
// WA_UploadResult2 Params Start
$WA_UploadResult2_Params = array();
// WA_UploadResult2_1 Start
$WA_UploadResult2_Params["WA_UploadResult2_1"] = array(
'UploadFolder' => "CatImages/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "2",
'ResizeWidth' => "250",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult2_1 End
// WA_UploadResult2 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult2", "Image", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult2_Params);
}
?>
<?php

// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $connFay;
$WA_table = "Catalog";
$WA_sessionName = "WADA_Insert_Catalog";
$WA_redirectURL = "Catalog_Insert.php";
$WA_keepQueryString = false;
$WA_indexField = "ItemID";
$WA_fieldNamesStr = "CatalogID|ItemName|Description|Price|Age|Category|Image";
$WA_fieldValuesStr = "".((isset($_POST["CatalogID"]))?$_POST["CatalogID"]:"") ."" . "|" . "".((isset($_POST["ItemName"]))?$_POST["ItemName"]:"") ."" . "|" . "".((isset($_POST["Description"]))?$_POST["Description"]:"") ."" . "|" . "".((isset($_POST["Price"]))?$_POST["Price"]:"") ."" . "|" . "".((isset($_POST["Age"]))?$_POST["Age"]:"") ."" . "|" . "".((isset($_POST["Category"]))?$_POST["Category"]:"") ."" . "|" . "".((isset($_POST["Image"]))?$_POST["Image"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_connFay;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<!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>Insert Catalog</title>
<link href="WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="WADAInsertContainer">
<form action="Catalog_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm" enctype="multipart/form-data">
<div class="WADAHeader"><h1 align="center">Insert Record</h1></div>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">CatalogID:</th>
<td class="WADADataTableCell"><input type="text" name="CatalogID" id="CatalogID" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ItemName:</th>
<td class="WADADataTableCell"><input type="text" name="ItemName" id="ItemName" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Description:</th>
<td class="WADADataTableCell"><input type="text" name="Description" id="Description" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Price:</th>
<td class="WADADataTableCell"><input type="text" name="Price" id="Price" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Age:</th>
<td class="WADADataTableCell"><input type="text" name="Age" id="Age" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Category:</th>
<td class="WADADataTableCell"><select name="Category" id="Category" value="" size="1" />
<option> </option>
<option>Active Play</option>
<option>Arts & Crafts</option>
<option>Calico Critters</option>
<option>Construction</option>
<option>Corolle Dolls</option>
<option>Games</option>
<option>Gears</option>
<option>Infants</option>
<option>Music</option>
<option>Play Mobile</option>
<option>Pretend Play</option>
<option>Puzzles</option>
<option>Science</option></td>
</tr>
<tr>
<th class="WADADataTableHeader">Image:</th>
<td class="WADADataTableCell"><input name="Image" type="file" id="Image" value="<?php echo $WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]; ?>" size="32"/></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="WA_DataAssist/images/Pacifica/Refined_insert.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="Catalog_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="WA_DataAssist/images/Pacifica/Refined_cancel.gif" /></a></td>
</tr>
<tr>
<td><h2 align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="Catalog_Search.php">Go to Search Page</a></h2></td></tr>
</table>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />
</div>
</form>
</div>
</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

in the insert record behavior, you must bind the file column to the WA Uploaded Files (File Field Name) -> Server File Name binding instead of the Form binding group that you are currently using.

Sign in to reply to this post

LWag48648773

FINALLY! Thank you for the help. I wish I had asked sooner. I see now that when I was doing the last step of changing the Insert Behavior, I was choosing the wrong thing which changed the wrong code. And then I was focusing on the wrong code to try to figure out what was wrong. I'm making notes so I won't struggle with this again.

btw - it does work with a blog but I like the text field better because I can actually see the name of the file now.

Thanks much.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

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