View Full Version : No File Uploaded: Help please
dreamweaver41056
05-19-2009, 04:40 PM
DW CS4 applied DFP 2.0 upload behavior to WA insert form with a file field. Permissions are correct on image directory.
Uploaded the updated DFP 2.0 directory to the server.
It writes the file name to the db but uploads nothing. No errors in the page or server side (checked error log).
Have checked form for errors and have reapplied behavior several different ways, each time re-uploading the library files
DFP1 always uploaded without problem.
Ray Borduin
05-19-2009, 05:27 PM
This is very odd. Maybe post a support incident. It thinks that it uploaded the file, so it probably did. Somehow it may be uploading to a different directory than you expect, or the file is getting deleted... I'm really not sure because this is not a known issue, but we are very interested in reproducing the problem and finding out what might be the cause.
You could also try posting the code for the upload here and I can look at it to see if I can spot an issue. There isn't much to go on with your description other than it doesn't work.
dreamweaver41056
05-19-2009, 06:30 PM
<form action="products_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">
<div class="WADAHeader">Insert Record</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">Name:</th>
<td class="WADADataTableCell"><input type="text" name="ProdName" id="ProdName" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Short Desc:</th>
<td class="WADADataTableCell"><textarea name="ProdShortDesc" id="ProdShortDesc" cols="32"></textarea></td>
</tr>
<tr>
<th class="WADADataTableHeader">Long Desc:</th>
<td class="WADADataTableCell"><textarea name="ProdLongDesc" id="ProdLongDesc" cols="32"></textarea></td>
</tr>
<tr>
<th class="WADADataTableHeader"> Price:</th>
<td class="WADADataTableCell"><input type="text" name="ProdPrice" id="ProdPrice" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">SKU:</th>
<td class="WADADataTableCell"><input type="text" name="ProdSKU" id="ProdSKU" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Thumb:</th>
<td class="WADADataTableCell"><input type="text" name="ProdThumb" id="ProdThumb" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Image:</th>
<td class="WADADataTableCell"><input type="file" name="ProdImage" id="ProdImage" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdCatID:</th>
<td class="WADADataTableCell">
<select name="ProdCatID" id="ProdCatID">
<?php
do {
?>
<option value="<?php echo $row_WADADynListprodcategory['CatID']?>"><?php echo $row_WADADynListprodcategory['CatName']?></option>
<?php
} while ($row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory));
$rows = mysql_num_rows($WADADynListprodcategory);
if($rows > 0) {
mysql_data_seek($WADADynListprodcategory, 0);
$row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory);
}
?>
</select>
</td>
</tr>
<tr>
<th class="WADADataTableHeader">Weight:</th>
<td class="WADADataTableCell"><input type="text" name="ProdWeight" id="ProdWeight" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Disc Min:</th>
<td class="WADADataTableCell"><input type="text" name="ProdDiscMin" id="ProdDiscMin" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">Disc Price:</th>
<td class="WADADataTableCell"><input type="text" name="ProdDiscPrice" id="ProdDiscPrice" 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="products_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Pacifica/Refined_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />
</div>
</form>
fragop363190
05-19-2009, 10:29 PM
Go up in the php code and copy/paste the uploads behavior's Parameters plz.
dreamweaver41056
05-20-2009, 06:04 AM
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../prodimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "clear.gif",
'ResizeType' => "2",
'ResizeWidth' => "450",
'ResizeHeight' => "0",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "ProdImage", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult1_Params);
}
?>
Ray Borduin
05-20-2009, 07:28 AM
Please post all of the code above the html in context. That might allow me to spot the problem.
dreamweaver41056
05-20-2009, 09:19 AM
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once('../Connections/handbagsWA.php'); ?>
<?php require_once("../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFile("WA_UploadResult1", "ProdImage", "../prodimages/clear.gif", "../prodpix/", "[FileName]", "2", "[FileName]_[Increment]", "0", "false", "0", "0");
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $handbagsWA;
$WA_table = "products";
$WA_sessionName = "WADA_Insert_products";
$WA_redirectURL = "product_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "ProdID";
$WA_fieldNamesStr = "ProdID|ProdName|ProdShortDesc|ProdLongDesc|ProdPri ce|ProdSKU|ProdThumb|ProdImage|ProdWeight|ProdDisc Min|ProdDiscPrice";
$WA_fieldValuesStr = "".((isset($_POST["ProdID"]))?$_POST["ProdID"]:"") ."" . "|" . "".((isset($_POST["ProdName"]))?$_POST["ProdName"]:"") ."" . "|" . "".((isset($_POST["ProdShortDesc"]))?$_POST["ProdShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProdLongDesc"]))?$_POST["ProdLongDesc"]:"") ."" . "|" . "".((isset($_POST["ProdPrice"]))?$_POST["ProdPrice"]:"") ."" . "|" . "".((isset($_POST["ProdSKU"]))?$_POST["ProdSKU"]:"") ."" . "|" . "".((isset($_POST["ProdThumb"]))?$_POST["ProdThumb"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["ProdWeight"]))?$_POST["ProdWeight"]:"") ."" . "|" . "".((isset($_POST["ProdDiscMin"]))?$_POST["ProdDiscMin"]:"") ."" . "|" . "".((isset($_POST["ProdDiscPrice"]))?$_POST["ProdDiscPrice"]:"") ."";
$WA_columnTypesStr = "none,none,NULL|',none,''|',none,''|',none,''|none, none,NULL|',none,''|',none,''|',none,''|none,none, NULL|none,none,NULL|none,none,NULL";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_handbagsWA;
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);
}
}
?>
<?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;
}
}
?>
dreamweaver41056
05-20-2009, 09:24 AM
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once('../Connections/handbagsWA.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;
}
}
?>
<?php
$maxRows_WADADynListprodcategory = 1000;
$pageNum_WADADynListprodcategory = 0;
if (isset($_GET['pageNum_WADADynListprodcategory'])) {
$pageNum_WADADynListprodcategory = $_GET['pageNum_WADADynListprodcategory'];
}
$startRow_WADADynListprodcategory = $pageNum_WADADynListprodcategory * $maxRows_WADADynListprodcategory;
mysql_select_db($database_handbagsWA, $handbagsWA);
$query_WADADynListprodcategory = "SELECT CatID, CatName FROM prodcategory ORDER BY CatName";
$query_limit_WADADynListprodcategory = sprintf("%s LIMIT %d, %d", $query_WADADynListprodcategory, $startRow_WADADynListprodcategory, $maxRows_WADADynListprodcategory);
$WADADynListprodcategory = mysql_query($query_limit_WADADynListprodcategory, $handbagsWA) or die(mysql_error());
$row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory);
if (isset($_GET['totalRows_WADADynListprodcategory'])) {
$totalRows_WADADynListprodcategory = $_GET['totalRows_WADADynListprodcategory'];
} else {
$all_WADADynListprodcategory = mysql_query($query_WADADynListprodcategory);
$totalRows_WADADynListprodcategory = mysql_num_rows($all_WADADynListprodcategory);
}
$totalPages_WADADynListprodcategory = ceil($totalRows_WADADynListprodcategory/$maxRows_WADADynListprodcategory)-1;?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../prodimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "clear.gif",
'ResizeType' => "2",
'ResizeWidth' => "450",
'ResizeHeight' => "0",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "ProdImage", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $handbagsWA;
$WA_table = "products";
$WA_sessionName = "WADA_Insert_products";
$WA_redirectURL = "products_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "ProdID";
$WA_fieldNamesStr = "ProdName|ProdShortDesc|ProdLongDesc|ProdPrice|Prod SKU|ProdThumb|ProdImage|ProdCatID|ProdWeight|ProdD iscMin|ProdDiscPrice";
$WA_fieldValuesStr = "".((isset($_POST["ProdName"]))?$_POST["ProdName"]:"") ."" . "|" . "".((isset($_POST["ProdShortDesc"]))?$_POST["ProdShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProdLongDesc"]))?$_POST["ProdLongDesc"]:"") ."" . "|" . "".((isset($_POST["ProdPrice"]))?$_POST["ProdPrice"]:"") ."" . "|" . "".((isset($_POST["ProdSKU"]))?$_POST["ProdSKU"]:"") ."" . "|" . "".((isset($_POST["ProdThumb"]))?$_POST["ProdThumb"]:"") ."" . "|" . "".((isset($_POST["ProdImage"]))?$_POST["ProdImage"]:"") ."" . "|" . "".((isset($_POST["ProdCatID"]))?$_POST["ProdCatID"]:"") ."" . "|" . "".((isset($_POST["ProdWeight"]))?$_POST["ProdWeight"]:"") ."" . "|" . "".((isset($_POST["ProdDiscMin"]))?$_POST["ProdDiscMin"]:"") ."" . "|" . "".((isset($_POST["ProdDiscPrice"]))?$_POST["ProdDiscPrice"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',non e,''|',none,''|',none,''|none,none,NULL|none,none, NULL|none,none,NULL|none,none,NULL";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_handbagsWA;
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);
}
}
?>
<?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;
}
}
?>
Ray Borduin
05-20-2009, 09:25 AM
Please post a support incident. I don't see the problem with this file, so somebody will have to help you debug it. The code appears correct to me.
dreamweaver41056
05-20-2009, 09:32 AM
Please ignore the first PHP code post. That was from a working DFP1 page that I built in CS3.
The second code paste is from the non-functioning DFP2/ CS4 page.
I backed up all of my WA includes for the different iterations as tar files (on the server) so I can flip back and forth.
I am under the gun to complete this project and may need to set up an alternative development site to troubleshoot this issue with DFP2.
Anyway since I can write to the folder using DFP1/CS3 and DW8/MX Kollection proves that this is not a server side issue (not that I ever thought it was).
Ray Borduin
05-20-2009, 10:12 AM
I still don't see the problem. Please post a support incident and somebody can help you debug this.
dreamweaver41056
05-20-2009, 10:48 AM
1. The form that I built in CS3 with DFP1 works exactly as before with the DFP2 include file.
2. I tried adding the progress bar script to the above file in CS4 with DFP2. The result is that the progress indicator works and so does the form.
This tells me that the problem is in the page code and possibly the extension itself...
I will open a support ticket when I have the time.
Ray Borduin
05-20-2009, 10:52 AM
Are you saying that the include file for DFP v2 breaks the code for DFP v1? I think you may be running into a bug that I would like to look into further, but I don't really fully understand the problem you are describing. Please either post a support incident or update this thread with a detailed description of how I can reproduce the problem.
Ray Borduin
05-20-2009, 10:55 AM
You should also try adding the debug data bindings to the page to see what's going on. See if there is an error or problem alerted. Check the folder and file names to make sure they are what you expect...
dreamweaver41056
05-20-2009, 11:02 AM
The opposite: the include file for DFP2 works with the DFP1 page and the DFP2 progress bar works with the DFP1 page; however, the DFP2 form does not work at all.
a. it does not write the file to the folder (although the folder is writable)
b. it does not write the file name to the db (although that is configured through DataAssist)
c. it does not write the default file name if image is not uploaded
d. the progress bar does not work in the DFP2 form (although it works in the DFP1 form)
I will post a support ticket later today or tomorrow (I have to finish this project to pay some bills).
dreamweaver41056
05-20-2009, 11:15 AM
You should also try adding the debug data bindings to the page to see what's going on. See if there is an error or problem alerted. Check the folder and file names to make sure they are what you expect...
I get the following debug when the page loads. Upon submitting the form I got no additional information.
Status object: WA_UploadResult1
statusCode : -1
errorMessage :
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : -1
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileSize : -1
imageWidth : -1
imageHeight : -1
Ray Borduin
05-20-2009, 12:09 PM
Get rid of the redirect code in the insert server behavior and see what the values are. Error -1 means no upload trigger fired, but it is probably just that you redirected before showing these values.
dreamweaver41056
05-20-2009, 03:31 PM
I moved the entire project to a sub-domain, built a new set of DataAssist pages, added file field, added file upload to form, bound the server file name to file field, and now the page writes to the db and uploads the file to the folder on the server.
One remaining problem, however, is the default file glitch. Even though I told the wizard the default file and location it did not write that info to the php code. I added the file name and location manually and ran my page without uploading a file and no file name was populated.
So I ran the wizard again and this time it populated its forms with the default file, etc. and after posting the wizard the statement remained in the code but the page still does not write the default file when no file is uploaded.
Is there a work-around now for the default file glitch? Or a patch?
Thanks for all of your help, Ray.
dreamweaver41056
05-20-2009, 03:36 PM
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../prodimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "../prodimages/clear.gif",
'ResizeType' => "2",
'ResizeWidth' => "450",
'ResizeHeight' => "0",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "ProdImage", "3", "[ExistingFileName]_[Increment]", "true", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $wandaWA;
$WA_table = "products";
$WA_sessionName = "WADA_Insert_products";
$WA_redirectURL = "prod_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "ProdID";
$WA_fieldNamesStr = "ProdName|ProdShortDesc|ProdLongDesc|ProdPrice|Prod SKU|ProdThumb|ProdImage|ProdCatID|ProdWeight|ProdD iscMin|ProdDiscPrice";
$WA_fieldValuesStr = "".((isset($_POST["ProdName"]))?$_POST["ProdName"]:"") ."" . "|" . "".((isset($_POST["ProdShortDesc"]))?$_POST["ProdShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProdLongDesc"]))?$_POST["ProdLongDesc"]:"") ."" . "|" . "".((isset($_POST["ProdPrice"]))?$_POST["ProdPrice"]:"") ."" . "|" . "".((isset($_POST["ProdSKU"]))?$_POST["ProdSKU"]:"") ."" . "|" . "".((isset($_POST["ProdThumb"]))?$_POST["ProdThumb"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["ProdCatID"]))?$_POST["ProdCatID"]:"") ."" . "|" . "".((isset($_POST["ProdWeight"]))?$_POST["ProdWeight"]:"") ."" . "|" . "".((isset($_POST["ProdDiscMin"]))?$_POST["ProdDiscMin"]:"") ."" . "|" . "".((isset($_POST["ProdDiscPrice"]))?$_POST["ProdDiscPrice"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',non e,''|',none,''|',none,''|none,none,NULL|none,none, NULL|none,none,NULL|none,none,NULL";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_wandaWA;
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);
}
}
?>
<?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;
}
}
?>
<!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"><!-- InstanceBegin template="/Templates/cms_base.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Insert products</title>
<!-- InstanceEndEditable -->
<link href="../wbc/C_M_S/cmsglobal.css" rel="stylesheet" type="text/css" />
<link href="../wbc/Global.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<!-- InstanceBeginEditable name="head" -->
<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" />
<script src="../WA_DigitalFilePro/jquery-blockui-formprocessing.js" type="text/javascript"></script>
<!-- InstanceEndEditable -->
</head>
<body><div align="center" class="header"><?php include('cmsheader.php'); ?></div>
<table width="600" border="0" align="center" bgcolor="#FFFFFF">
<tr>
<td align="center"><!-- InstanceBeginEditable name="title" -->
<p class="PageName">Title Here </p>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td align="center"><div class="mainAdm" id="cm">
<table width="100%" border="1" cellpadding="5" cellspacing="5" bordercolor="#CCCCCC">
<tr>
<td align="center">
<!-- InstanceBeginEditable name="maincont" -->
<p> </p>
<div class="WADAInsertContainer">
<div id="WADAInsertForm_ProgressWrapper">
<form action="prod_Insert.php" method="post" enctype="multipart/form-data" name="WADAInsertForm" id="WADAInsertForm">
<div class="WADAHeader">Insert Record</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">Name:</th>
<td class="WADADataTableCell"><input type="text" name="ProdName" id="ProdName" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ShortDesc:</th>
<td class="WADADataTableCell"><textarea name="ProdShortDesc" id="ProdShortDesc" cols="32"></textarea></td>
</tr>
<tr>
<th class="WADADataTableHeader">LongDesc:</th>
<td class="WADADataTableCell"><textarea name="ProdLongDesc" id="ProdLongDesc" cols="32"></textarea></td>
</tr>
<tr>
<th class="WADADataTableHeader">Price:</th>
<td class="WADADataTableCell"><input type="text" name="ProdPrice" id="ProdPrice" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdSKU:</th>
<td class="WADADataTableCell"><input type="text" name="ProdSKU" id="ProdSKU" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdThumb:</th>
<td class="WADADataTableCell"><input type="text" name="ProdThumb" id="ProdThumb" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdImage:</th>
<td class="WADADataTableCell" id="ProdImage"><input type="file" name="ProdImage" id="ProdImage" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">ProdCatID:</th>
<td class="WADADataTableCell"><select name="ProdCatID" id="ProdCatID">
<option value="">cats</option>
<?php
do {
?>
<option value="<?php echo $row_WADADynListprodcategory['CatID']?>"><?php echo $row_WADADynListprodcategory['CatName']?></option>
<?php
} while ($row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory));
$rows = mysql_num_rows($WADADynListprodcategory);
if($rows > 0) {
mysql_data_seek($WADADynListprodcategory, 0);
$row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory);
}
?>
Ray Borduin
05-20-2009, 03:57 PM
Post a support incident about the default value bug... they are distributing a fix until we can get a dot release out.
fragop363190
05-20-2009, 10:06 PM
There is a new HelperPHP file distributed currently. It came out yesterday. I didn't check it yet ill post as soon as i check it.
If the behavior hasn't trigered means that you must have done sth accidently or even DataAssist may be doing it for some reason (mine works fine after i fixed my permissions in folders). Check code if you can understand a few stuff so you see when the triger is fired. Maybe you accidently put the behavior to run after wrong button is pressed?
When u run the behavior it asks you when the triger should fire. Check you have selected the correct one.
dreamweaver41056
05-21-2009, 09:03 AM
In my last post I stated that I got everything to work except the default file value if no file is uploaded.
Does the HelperPHP file you mentioned address that issue?
If so where is it?
Thanks
Ray Borduin
05-21-2009, 10:10 AM
Yes it does. Please post a support incident on the webassist site and they can give you the latest copy of that file.
dreamweaver41056
05-21-2009, 06:25 PM
I posted a support incident earlier today and received the helper file about an hour later.
Thanks to everyone for the help.
dreamweaver41056
05-22-2009, 01:33 PM
Got everything working on the website I was having problems with, then went back to work on another website where DFP1 was working correctly.
Built a new set of forms with Data Assist, one of them being an insert form with 7 image fields.
Configured all of my settings for the DFP 2.0 upload behaviors and the inset record behaviors.
When the form is submitted it posts the clear gif path to all of the fields regardless of whether a file is uploaded or not. No file is ever uploaded.
I have tried renaming the Helper File in order to create a new one and I get the same results.
The old DFP1 form still works correctly. Even tried replacing some of the DFP2 upload params with DFP1 upload params and get the same thing.
fragop363190
05-22-2009, 04:02 PM
Honestly i didn't try the new Helper file since i fixed a working patch and does my job for the moment.
I will be able to test it in a week as im closing a major project and can't play with this one.
So no i didn't test it and I don't know if it works but Ray says it does. (dreamweaver41056)
dreamweaver41056
05-22-2009, 04:15 PM
The helper file corrects the default file value glitch. I have everything working fine on the website I was originally having problems with but on website 2 one all the form will do is write the default value. It doesn't upload anything. I built another form in CS3/DFP1 for website 2 and it works properly with the same table and the same folder.
I too have projects to complete and can't spend any more time on this.
Hopefully WA will issue a dot release soon.
dreamweaver41056
05-22-2009, 04:16 PM
* on website 2 all the form will do*
Ray Borduin
05-26-2009, 08:25 AM
I'm not sure that I understand the problem that you are descibing. Please make sure to post a support incident and somebody can help you with this directly.
rich283128
05-26-2009, 05:13 PM
Your forum message titled "insert form code" in the 3rd forum message is missing the following code in the <form> area:
enctype="multipart/form-data"
Isn't that important? Can the upload complete without it?
By the way, I had a hard time getting a file to upload. I had to change the permission of the upload folder from 775 to 777 before file would upload. I think it has something to do with Apache not allowing PHP to write to the folder, because a ftp program has no problem writing to it. Does anyone know a better way to resolve this issue? Thanks, Rich
fragop363190
05-26-2009, 11:58 PM
This depends on your service providor, i had to make them 777 too. You can't do anything about it. Just give 777 to the particular folder and not the one above it and you should be safe.
Yes you need the multipart thing to upload page.
As for the problem with the insert page. I am assuming that you just have the recordset on that page and no hidden file as in the update.php. Check that Insert Behavior at the database column where you add the filename uses the DFPUpload recordset and pointing to the Server File Name and not any FORM element.
The reason you get that default file is probably cause at the Insert Behavior you have the FILE FIELd binded to it, instead of BINDING the Upload Behaviors Recordset/Server File Name.
Please tell me if you understood it and if you need more help.
Sorry for delay i am currently over my head with a project.
dreamweaver41056
05-27-2009, 12:22 PM
I'm not sure that I understand the problem that you are descibing. Please make sure to post a support incident and somebody can help you with this directly.
---------------
This thread has gone on for eight days now and you have responded to my earlier posts with an apparent understanding of the problem.
The good news is I'm over the crisis now because I've created my own patch, so to speak. First I use the old DFP1 in DW CS3 and then I modify the behavior in DW CS4 using DFP2.
Do you know when they're going to fix this extension and release a dot version?
Summary:
You told me that if I opened a support ticket they would provide me with the file.
Next, I opened a support ticket and I posted to this thread that I opened a support ticket and received the helper file.
I also posted that I cloned the site I was working on, started anew in Dreamweaver and the extension worked except for the default file glitch which was resolved by the new helper file.
Then, I posted that I went back to another site I was working on and the extension pretty much did not work at all so I had to apply the behaviors in DW3 (instead of DW4) using DFP1. After building the page in this way I was then able to apply the additional behaviors, thumbnails, progress bar, etc in DW4 and DFP2 successfully.
I appreciate all of your help Ray. You have a tough job for sure.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.