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

File Manipulation: Upload Wizard - image overwriting issue

Thread began 7/07/2011 10:27 am by Jared Lui | Last modified 7/12/2011 3:23 pm by Jared Lui | 1420 views | 7 replies

Jared Lui

Still having issues...

Okay, I'm sure this has got to be user error otherwise I'm sure you'd have complaints about this all the time. However after following the instructions at least 10 times starting completely from scratch and even with a plain DB with only 1 field and a insert/update form with only 1 field I still cannot get this to update properly unless I specify a new upload each time. I've gone so far as have people sit with me as I go through the steps and have had 2 others try it for themselves.

And in case I was unclear previously, my issue is when I update a record using the Update page, the file names are removed from the database. The Insert form works perfectly and even creates the thumbnail correctly. The Update form seems to replace the filename in both the image and thumb column with blank info, unless I choose a new image file to replace it. Also the "hidden" field is not working that would display the current filename when you enter the Update page.

Below are my exact steps in bold and the WA tutorial in normal text. I'd like to know exactly where I am going wrong. Otherwise there is an issue with something else in which case I am including my insert and update files and the SQL per usual.
Applying Digital File Pro to your Update page
With your Insert page complete, you now need to do the same with the Update page. The process is similar, but requires an additional step.
Creating the file field
Use the following instructions for creating this field for your Insert page.
1. From the Dreamweaver Files panel, open your DataAssist Insert or Update page.
I have figure_lines_Update.php open in CS4

2. Select the field you want to replace with a file upload field.
I was using a binding of the recordset before to make this same thing happen. I since deleted it and created a text field and called it Old_Image. I then selected it

3. On your keyboard, press Ctrl (Cmd) + T. This displays the Quick Tag Editor.
Pressed Ctrl + t and brought up the quick tag editor

4. Change <input type=”text”> to <input type=”hidden”>.
Changed the type from "text" to "hidden"

Note: This is done to allow us to display the value for the form field that is currently entered into the database.
This is one of the items that is not working before or after clicking the Update button. Question: is this necessary for the rest of the update page to work or would I have been fine just displaying this info using the binding as before?

5. Place your cursor beside the hidden form field icon.
Cursor is next to hidden form field icon

6. Choose the File field option from Forms category of the Insert bar.
There is now a File Field next to the hidden form field icon

7. Place your cursor in the ID field and enter an id for this field.
I named the ID of this file field Line_Image. This is the same as the corresponding column name in the database. Is this an issue?

8. Leave the Label field blank.
made no other changes

9. Click OK.
No issues here

Applying Digital File Pro
Next you will want to apply the Digital File Pro Upload behavior to your new file field.
10. In Dreamweaver, open the Insert page.
Still have the figure_lines_Update.php file open from the first 9 steps

11. From the Insert menu, choose WebAssist > Digital File Pro > Upload.
Actually it was Insert > WebAssist > File Manipulation > Upload and I got the Upload Wizard

12. From the File field option, choose the file field you just created.
The field field I created "Line_Image" was already selected and the only option available in the dropdown

13. Click Next.
I've filled out the rest of step 1 and have also just hit next going this this process in case it made a difference taking notice of the note after step 18.

14. On Step 2, specify the Upload directory you wish to store these images.
I selected the same directory as the insert page, ../../images/line_main/

15. Choose the Default file value lightning bolt.
I did this

16. Expand the WADAUpdateForm option.
I did this too

17. Choose the form field you set to hidden earlier.
I chose Old_Image from the WADAUpdateForm. It had the same hidden field icon as the CS4 Forms menu

18. Click OK.
Done. As stated in step 13, I also tried this several different ways taking notice of the note that follows by leaving everything else alone or adding the the additional thumbnail image as I did in the Insert page (which works great by the way)

Note: The remaining settings should be specified as they were with the Insert page.

19. Click Finish to create the file upload behavior.
Clicked Finish and the system created the code

Updating the Update Record server behavior
We now need to update the DataAssist Update record server behavior to accommodate the file field.

20. From the Server Behaviors panel, double-click on the Update Record option.
This brought up the Update Record Wizard

21. Click Next to proceed to step 2.
I left all fields untouched and clicked Next

22. Select the column you applied the file field to.
I clicked Line_Image and the row was highlighted and the Data type showed as Text and the Value was empty

23. Click the value lightning bolt.
I did this

24. Expand the WA Upload File option for your column.
There was an already expanded node Upload Files (Line_Image) that I believe is correct

25. Choose Server File Name.
I did this and this is the value: <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>

I also did this for Line_Thumbnail but chose ../../images/line_main/[FileName] (2): Server File Name from the WA Upload File (Line_Image) as I did for the Insert page. This is the value for it: <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["WA_UploadResult1_2"]["serverFileName"]; ?>

26. Click OK.
I did this

27. Click Finish.
Did this too

So that's what I've been doing. The steps are not hard and I am pretty sure I am not missing anything during them. I must have something else messed up.

Attached are my insert and update files.

Here is the SQL from both as well in case its needed. Let me know what else I can provide. Thanks in advance.

From the Results page after Insert:
SQL: SELECT Line_Id, Line_Name, Line_Nickname, Start_Decade, End_Decade, Manufacturer, Size, Cat_1, Cat_2, Cat_3, Approved, Locked, Added_By, Line_Text FROM figure_lines ORDER BY Line_Name ASC LIMIT 0, 10

From the Results page after Update
SQL: SELECT Line_Id, Line_Name, Line_Nickname, Start_Decade, End_Decade, Manufacturer, Size, Cat_1, Cat_2, Cat_3, Approved, Locked, Added_By, Line_Text FROM figure_lines ORDER BY Line_Name ASC LIMIT 0, 10

Attached Files

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





Ease of use


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