close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Existing images disappear when updating

Thread began 10/25/2009 9:24 pm by nancy | Last modified 10/26/2009 10:46 am by Jason Byrnes | 1290 views | 2 replies |

nancy

Existing images disappear when updating

Help!
All pages created with DA. Followed directions for adding DFP to DA Insert and Update pages.
The Insert works fine. The files are uploaded and display on the results (thumbnail) and Detail (full size) and datbase gets an entry in the field.

The problem comes when any field on the form is updated. Unless the image file is re-browsed and uploaded, the image is not displayed on the Results and Detail and the database (thru myPHPAdmin) has been returned to NULL.

Thanks in advance.

Below is the code from the php portion of the update page

<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../himages/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "400",
'ResizeHeight' => "266",
'ResizeFillColor' => "#FFF5cc" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "../himages/thumb",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "140",
'ResizeHeight' => "104",
'ResizeFillColor' => "#FFF5cc" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End
?>
<?php?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Update_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "Image1update", "0", "", "true", $WA_UploadResult1_Params);
}
?>

Markup
<td class="WADADataTableCell"><input type="hidden" name="Image1" id="Image1" value="<?php echo(str_replace('"', '&quot;', $row_WADAproperty['Image1'])); ?>" size="32" tabindex="6" />
<br />
<label>
<input type="file" name="Image1update" id="Image1update" />
</label></td>

Sign in to reply to this post

nancy

Just tried the enter key to set the default file

After the post - I read some more and found the post about the enter key (post 5368)

Used it and the Default file changed to:
'DefaultFileName' => "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."",

But still lost the database entry and display upon updating another field.

Sign in to reply to this post

Jason ByrnesWebAssist

You are setting the default file to the server file name.


On the update page, you will create a hidden file field to hold the original file name ffrom the database. the default file should be set to use this hidden form elemetnt instead of the server file name.

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