I am not having any luck figuring this out. Still don't have a server file name choice for the thumbs.
Here are some more details. First, I'm using DFP 2.0.2.
I have one WA upload behavior with two images being generated. A large and a thumb. I will paste my code below.
Upload behavior.
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "images/gallery/",
'FileName' => "[FileName]_large",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "700",
'ResizeHeight' => "525",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "images/gallery/thumbs/",
'FileName' => "[FileName]_thumb",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "300",
'ResizeHeight' => "225",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Submit"])){
WA_DFP_UploadFiles("WA_UploadResult1", "image", "0", "", "JPG:70", $WA_UploadResult1_Params);
}
?>
Insert behavior. (Data Assist 2.0.5)
<?php
// WA Application Builder Insert
if (isset($_POST["Submit"])) // Trigger
{
$WA_connection = $localhost;
$WA_table = "tblGallerysp";
$WA_sessionName = "tblGallerysp_id";
$WA_redirectURL = "results.php";
$WA_keepQueryString = false;
$WA_indexField = "id";
$WA_fieldNamesStr = "id|imagethumb|imageorig|labeltext";
$WA_fieldValuesStr = "".((isset($_POST["id"]))?$_POST["id"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["imagelabel"]))?$_POST["imagelabel"]:"") ."";
$WA_columnTypesStr = "none,none,NULL|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_localhost;
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);
}
}
?>
Should I just change this line in the insert?...
$WA_fieldValuesStr = "".((isset($_POST["id"]))?$_POST["id"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["imagelabel"]))?$_POST["imagelabel"]:"") ."";
To...
$WA_fieldValuesStr = "".((isset($_POST["id"]))?$_POST["id"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1_1"]["serverFileName"] ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1_2"]["serverFileName"] ."" . "|" . "".((isset($_POST["imagelabel"]))?$_POST["imagelabel"]:"") ."";
I'll try it, but is this correct?
Thanks,
TroyD