close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Digital file Pro - image is lost in update file

Thread began 5/10/2012 12:12 pm by ori382079 | Last modified 7/11/2012 3:48 pm by Jason Byrnes | 2708 views | 9 replies |

ori382079

Digital file Pro - image is lost in update file

Please assist me, I 'm using Digital file Pro to upload images but the image is not shown whenever an update takes place in the record. The image file path is completely lost during update, displaying a tiny image placeholder in the result page or elsewhere.

I would expect the image path to remain if not updated.

Please see that attached file.

Thanks for you prompt action.

Attached Files
digital pro.txt
Sign in to reply to this post

Jason ByrnesWebAssist

see the "Applying File Upload to DataAssist Insert and Update pages (PDF)" tutorial on the data assist support page.


basically, you need to add a hidden form element to your page, Set the initial value of the hidden element to use the image column from your recordset, then in the Upload file behavior, bind the default file setting to the hidden element.

Sign in to reply to this post

ori382079

Re:Digital file Pro - image is lost in update file

Hi Jason, thanks for the quick response.

I had followed the instruction carefully, but when I need to update any record (other than these 2 fields), the thumbnail and product image fields return no data, and when I submit the updated record, the thumbnail and product image fields have no images in them.

The fields in this updated record show the missing image icon.

Please I include the details in the attached doc in order to reproduce it.
Thanks

Attached Files
DG_Pro.txt
Sign in to reply to this post

Jason ByrnesWebAssist

in the upload file behaviors, you have bound the Default File to the Image and Thumbnail File Fields.

You _should_ be using the bindings for the ProductThumb and ProductImage hidden form elements instead.

Sign in to reply to this post

t.weijers438628

is it ok now?

Hi, i like to know if your problem is solved now.

i'm struggling about the same issue, tried several solutions, also the pdf in the support, for hours....
but, i can't get it working....

thnx.
Tom

Sign in to reply to this post

Jason ByrnesWebAssist

please post a copy of your page so I can see the code.

Sign in to reply to this post

t.weijers438628

copy of file

<?php require_once('../Connections/connamsterdam.php'); ?>
<?php require_once("../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "administrator,user";
$MM_donotCheckaccess = "false";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "../users/noAccess.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?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;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form2")) {
$updateSQL = sprintf("UPDATE company SET name=%s, adress=%s, postalcode=%s, phonenr=%s, url=%s, email=%s, category=%s, ranking=%s, info=%s, image=%s, addon=%s, userID=%s WHERE companyID=%s",
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['adress'], "text"),
GetSQLValueString($_POST['postalcode'], "text"),
GetSQLValueString($_POST['phonenr'], "int"),
GetSQLValueString($_POST['url'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['category'], "text"),
GetSQLValueString($_POST['ranking'], "text"),
GetSQLValueString($_POST['info'], "text"),
GetSQLValueString($_FILES['image']['name'], "text"),
GetSQLValueString($_POST['addon'], "date"),
GetSQLValueString($_POST['userID'], "int"),
GetSQLValueString($_POST['companyID'], "int"));

mysql_select_db($database_connamsterdam, $connamsterdam);
$Result1 = mysql_query($updateSQL, $connamsterdam) or die(mysql_error());

$updateGoTo = "../users/user_specs.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}

$colname_rs_editCompany = "-1";
if (isset($_GET['companyID'])) {
$colname_rs_editCompany = $_GET['companyID'];
}
mysql_select_db($database_connamsterdam, $connamsterdam);
$query_rs_editCompany = sprintf("SELECT * FROM company WHERE companyID = %s", GetSQLValueString($colname_rs_editCompany, "int"));
$rs_editCompany = mysql_query($query_rs_editCompany, $connamsterdam) or die(mysql_error());
$row_rs_editCompany = mysql_fetch_assoc($rs_editCompany);
$totalRows_rs_editCompany = mysql_num_rows($rs_editCompany);?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../uploads/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_POST["default"]))?$_POST["default"]:"") ."",
'ResizeType' => "1",
'ResizeWidth' => "240",
'ResizeHeight' => "180",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "../uploads/thumbs/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "1",
'ResizeWidth' => "100",
'ResizeHeight' => "80",
'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", "", "true", $WA_UploadResult1_Params);
}
?>
<?php
thnx,
Tom.

Sign in to reply to this post

Jason ByrnesWebAssist

you are using the Dreamweaver Update record behavior on this page.

The limitation to the dreamweaver update record behavior, is that it can only use form data.

It cannot use the Server File name variable that is created by the upload behavior to hold the name of the uploaded file.

you will need to use the Data Assist Update record behavior for this.

Sign in to reply to this post

t.weijers438628

ok

Ok, thnx.

is that included in digital file pro?

Tom.

Sign in to reply to this post

Jason ByrnesWebAssist

No, it is included in Data Assist or Data Bridge.

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