close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Trouble combining Data Assist Insert Record & Digital File Pro

Thread began 3/20/2010 9:00 am by mattoconnell298972 | Last modified 3/21/2010 7:56 am by mattoconnell298972 | 1988 views | 4 replies |

mattoconnell298972

Trouble combining Data Assist Insert Record & Digital File Pro

Hi,

I am having trouble combining these two functionalities.

I can use Data Assist Insert Record to upload text to my database no worries.
I can upload files to my server using DFP no worries.

If I have both on the same page and want to send the filename to a field in my database the image doesn't upload and the filename isn't sent to the database.

I have seen the forum posts and tutorial where it says to get the Server Filename variable for Data Assist - but which ever variable I select, none seem to work.

Is there a trick to this??

This is the code:

Thanks for any help in advance.

<?php require_once('../../Connections/connTest.php'); ?>
<?php require_once("../../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("../../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../images/user/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "85",
'ResizeHeight' => "85",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "thumbUpload", "0", "", "JPG:80", $WA_UploadResult1_Params);
}
?>
<?php
require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php require_once( "../WA_Globals/WA_Globals.php" ); ?>
<?php require_once( "../WA_CMS/WA_CMS.php" ); ?>
<?php require_once('../Connections/localhost.php'); ?>
<?php require_once("../../HTMLEditor/WARichEditorPHP.php"); ?>
<?php
// WA Application Builder Insert
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $connTest;
$WA_table = "content";
$WA_sessionName = "contentID";
$WA_redirectURL = "newsDetail.php";
$WA_keepQueryString = false;
$WA_indexField = "contentID";
$WA_fieldNamesStr = "contentTitle|thumbImg|contentHome|contentLong|contentShort|date";
$WA_fieldValuesStr = "".((isset($_POST["contentTitle"]))?$_POST["contentTitle"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["contentHome"]))?$_POST["contentHome"]:"") ."" . "|" . "".((isset($_POST["contentLong"]))?$_POST["contentLong"]:"") ."" . "|" . "".((isset($_POST["contentShort"]))?$_POST["contentShort"]:"") ."" . "|" . "".((isset($_POST["contentDate"]))?$_POST["contentDate"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_connPriefert;
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
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../images/user/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "85",
'ResizeHeight' => "85",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
?>

Sign in to reply to this post

CraigRBeta Tester

i notice that the default file path is empty.

take a look at this post which may help...

showthread.php?t=9239

Sign in to reply to this post

mattoconnell298972

No Luck

Hi Craig,

Thanks for the reply....I tried adding a default filename but still no luck.
The problem is, if I try any of these things separately, like just uploading a file - I have no problems.
If I have a text input field and I want to insert a daatbase record - also no problems.
But if I want to upload a file and send the filename to the database, that's when it doesn't work.
No file uploads and no record in the db.

Not sure what the problem is??

Sign in to reply to this post

CraigRBeta Tester

here is a troubleshhoting tip...

on the insert page, change line...
$WA_redirectURL = "tblsuccess_results.php";

to:
$WA_redirectURL = "";


so that the page will not redirect.


then go the the bindings panel and expand the WA Digital File pro Global Status group, add the debug info binding to the page.
Please post back the debug info results after trying to upload a file.

this should indicate what is going wrong, and maybe someone can help a bit further

regards

Sign in to reply to this post

mattoconnell298972

Crisis Over

Thanks for the help Craig, I had an incorrect redirect!! Working OK now.

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