DFP db filename gets overwritten on update
Hi, in a previous forum I posted my question, my issue remains unresolved. Im pasting my question from it to here.
"I was just about to post a thread about this issue as well and saw this so I am tagging my issue here too.
I have DigitalFilePro 2.02 and can update a record, and get filename in database, however if I return to the update form and leave some of the fields blank, it will erase any entry in the database that wasn't updated with a file.
some specs digitialfilepro 2.02
dreamweaver cs3
windows vista home premium
64 bit "
sojowebreplied:
contact,
It sounds like you need to populate your form fields on your update page with the existing values in the database... that way, regardless of whether you edit them or not, the original value is submitted. if you have any questions how to do this, just drop a line here.
Best regards,
Brian
__________________
Brian Michel
SOJO web LLC
--
I replied:
thanks for the prompt reply,
I thought my hidden field was doing that, is this enough code for you to determine if I have entered it correctly? - following the tutorial...
Ive added more code sample here..
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "images/profile",
'FileName' => "images/profile/".$_SESSION['MemberID'] ."_avatar",
'DefaultFileName' => "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."",
'ResizeType' => "2",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End?>
<tr>
<td class="WADADataTableCell"><input type="hidden" name="AvatarFileName" id="AvatarFileName" value="<?php echo(str_replace('"', '"', $row_WADAmember['AvatarFileName'])); ?>" size="32" />
<input type="file" name="AvatarFileNameUPD" id="AvatarFileNameUPD" /></td>
</tr>
Edit> As I explore this more I realize this is strange, some fields seem to work ok and do not get deleted on a new update, others do not. I have manually edited the code to read the existing values, but some fields wont let the edits 'stick' if i go back into the WA Upload files wizzard it occaisionally looses the 'default filename' code.
sojoweb replied.
One thing I noticed is that you have your DFP files flipped... the file you are uploading - meaning $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] should be in the File Name of the DFP since that is the one that is actually being uploaded or changed. The Default file name is used to specify the image that will be used (typically the previous one uploaded) in the case that there is no image uploaded on the update page. To code this correctly, you should actually store the recordset value from the image field into a hidden field on your form... then inside the DFP dialog box, you would set the Default File to the hidden form field containing your image value from the original recordset.
Also, with the rest of your fields on the form, be sure that you are actually just populating the input fields themselves... you shouldn't need to use hidden fields for the non-image or non-file upload fields.
Regards,
Brian
__________________
Brian Michel
SOJO web LLC