close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

images upload but filename not moving into db

Thread began 9/23/2009 8:14 am by iain.sutherland290832 | Last modified 9/23/2009 10:24 am by iain.sutherland290832 | 3190 views | 6 replies |

iain.sutherland290832

images upload but filename not moving into db

having an issue. always worked in the past with v1, but in v2, now getting an issue where all the form fields are carried into the db, except for the file names. I have used the WA behaviors to set the server file name but they are not being carried into the DB

the link to the test page for this function is:

itemimages_Insert.php?ItemID=12

have i missed something?

code on top of page is:

<?php require_once("../Connections/mayther.php"); ?>
<?php
$ItemID = $_GET[ItemID];
?>
<?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/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "100",
'ResizeHeight' => "100",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "images/imagesmedium/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "300",
'ResizeHeight' => "300",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1_3 Start
$WA_UploadResult1_Params["WA_UploadResult1_3"] = array(
'UploadFolder' => "images/largeimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "629",
'ResizeHeight' => "473",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_3 End
// WA_UploadResult1_4 Start
$WA_UploadResult1_Params["WA_UploadResult1_4"] = array(
'UploadFolder' => "images/originalitems/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "800",
'ResizeHeight' => "600",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_4 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "FileName", "2", "[NewFileName]_[Increment]", "JPG:80", $WA_UploadResult1_Params);
}
?>
<?php
$itemid = $_GET[ItemID]; ?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $mayther;
$WA_table = "itemimages";
$WA_sessionName = "WADA_Insert_itemimages";
$WA_redirectURL = "itemimages_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "imageID";
$WA_fieldNamesStr = "ItemID|imagesmall|imagemed|imagelarge|imagedescription";
$WA_fieldValuesStr = "".((isset($_POST["ItemID"]))?$_POST["ItemID"]:"") ."" . "|" . "".((isset($_POST["imagesmall"]))?$_POST["imagesmall"]:"") ."" . "|" . "".((isset($_POST["imagemed"]))?$_POST["imagemed"]:"") ."" . "|" . "".((isset($_POST["imagelarge"]))?$_POST["imagelarge"]:"") ."" . "|" . "".((isset($_POST["imagedescription"]))?$_POST["imagedescription"]:"") ."";
$WA_columnTypesStr = "none,none,NULL|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_mayther;
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);
}
}
?>

Sign in to reply to this post

tom92909Beta Tester

Did you upload the new version of the Digital File Pro extension to your web server?

../WA_DigitalFilePro/HelperPHP.php

Sign in to reply to this post

iain.sutherland290832

yep - re posted

tried that,

tried changing file types and conversions options
tried changing filename
moved image folder to a higher level in case it was a ../ issue

now also getting more errors (as the page has been re-edited so many times)

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sites/mayther.co.uk/public_html/WA_DigitalFilePro/HelperPHP.php:4) in /home/sites/mayther.co.uk/public_html/WA_DigitalFilePro/HelperPHP.php on line 73

Warning: Cannot modify header information - headers already sent by (output started at /home/sites/mayther.co.uk/public_html/WA_DigitalFilePro/HelperPHP.php:4) in /home/sites/mayther.co.uk/public_html/admin/itemimages_Insert.php on line 85

i may have to start a fresh page

Sign in to reply to this post

tom92909Beta Tester

Have you tried stripping out the entire behavior from your page, verifying that you only have the form on your page, saving your page and then starting over?

Sign in to reply to this post

iain.sutherland290832

yep

tried that here addanimage.php?ItemID=12 but get exactly the same issue

Sign in to reply to this post

Jason ByrnesWebAssist

In the Insert record server behavior, you are binding the Image columns to the file Form elements.


Digital File Pro Creates a new data binding group WA Uploaded Files (File Field Name)


In this group is a Server File Name variable. One is created for each upload location, for example:
images/thumbs/[FileName]: Server File Name
images/imagesmedium/[FileName]: Server File Name

In the insert record server behavior, you should bind the image columns to the Server File Name Varibles created by DFP.


See the How to apply Digital File Pro to DataAssist Insert and Update pages tutorial on the DataAssist support page in the How To section:
dataassist/

Sign in to reply to this post

iain.sutherland290832

hmmm ... That was where I started the process, but it did not carry the filenames to the db so I tried every other permutation I could think of. will try it again. the page has been through about 10 hours of different versions.


and guess what - it worked - i must have been having a mad moment this morning - thanks for assistance

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