close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

file manipulation with Design Extender package

Thread began 3/18/2012 10:36 am by turk361661 | Last modified 3/21/2012 3:37 pm by Jason Byrnes | 812 views | 7 replies |

turk361661

file manipulation with Design Extender package

Hi,

I created an update form for one of my web pages. I need to modify some of the fields so that a file can be uploaded to the server, replacing the old file.
I recently purchased Design Extender and how to accomplish file upload task seems to have changed a bit from before.

I followed the instructions found in the support section for adding file manipulation >upload file to my form.

attached is my file.
On this update for page, I can use the browse button and select a file to upload. The file name in the database gets updated okay.
But the file does not actually get uploaded to the directory on the server.
Right now I'm working on a local server.
I tried several different settings but am unable to figure out the problem. I need help.
Can you review my file. See attached.

Thanks for your help,
Danielle

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

Jason ByrnesWebAssist

there are a number of problems with the page you have sent:

1) you will not be able to use the Dreamweaver Insert Behavior to store the uploaded file name to your database.This can only be done using the Data Assist Insert / Update record behavior.


File upload works like this:

the form sends the file to server

the server saves that file to upload folder you specify and performs any necessary renaming of the uploaded file if it already exists, or other formatting based on your settings in the upload wizard.

the file name is saved in a variable that has a binding in the bindings panel under WA Uploaded Files (File Field Name) -> Server File Name

The limitation to the Dreamweaver Insert / Update record behavior is that it can only use form elements to get information to store, it cannot access the server file name variable that the upload creates, this is why Data Assist must be used instead.

2) The upload code references a file field named "AvailFile2" but yours is named "AvailFile"

<input type="file" name="AvailFile" id="AvailFile" />



this is the same name as a hidden form element on your page:

php:
<input type="hidden" name="AvailFile" value="<?php echo htmlentities($row_rsAvail['AvailFile'], ENT_COMPAT'utf-8'); ?>" size="32" />



all form elements must use a unique name.

3) for file upload to work properly, the form encoding type must be set to multipart/for-data.

in the tag selector, select the form tag, in the encoding type select list, select multipart/form-data

Sign in to reply to this post

turk361661

Hi Jason,

I started over. I had so much wrong, I had too.

Attached is my new file. When I open this php page in my browser and I enter information into the form, everything in my database updates correctly. Seems to be working great this way.
I basically want this simple form, working as is.. But changing the box next to "AvailFile:" from an input text field box to an File Upload field, so that a file can be uploaded to a folder (documents) on the server and the file name is updated in the "AvailFile" column of my database.

If I need to use DataAssist, How can I accomplish this in a simple fashion. When I open the DataAssist Wizard I get options for creating Display, Update, Insert, Search, etc. pages... much more than what I need.

Please advise. Thanks again for your help!
Danielle

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

Jason ByrnesWebAssist

first select the AvailFile text box, the use the delete key to delete it.

go to Insert -> Form File Field to add a file field, set the name of the file field to "AvailFile"

next to the File field, add a hidden form element named existingAvailFile. in the property inspector, click the lightning bolt next to Initial Value and select the AvailFile column from the recordset

you will need to delete the Dreamweaver update record behavior from the page. Go to the server behaviors Panel (Window -> Server Behaviors) Select the Update Record behavior, and click the minus button to remove it.

Next add the upload File Behavior (Webasssist -> File Manipulation -> Upload File). On the second step of the upload behavior, click the lightning bolt next to Default File and select the existingAvailFile hidden form element.

Now add the Data Assist update record behavior, in the server behaviors panel, click the plus button and select DataAssist -> Update Record _ Update Single record

For the key column, select the AvailID column, next to the value, click the lightning bolt and select the AvailID Form Element.

On the second page, click select each column (except the AvailID column) and click the lightning bolt next to value and select the corresponding form element.

for the AvailFile column, expand the WA Uploaded Files (AvailFile) Binding group and select the ServerFile name binding.

Sign in to reply to this post

turk361661

Hi Jason,

Thanks for the detailed instructions. Very helpful!
When I get to the step "Now add the Data Assist update record behavior...) I receive an error message. See screen shot attached.
My assumption is that this is an error with one of the WebAssist extensions and not my file.

Before I started this project I installed Design Extender. After doing so, my DataAssist buttons were grayed out, and I could not use the DataAssist functions. So I uninstalled and reinstalled DataAssist. Everything seemed to be working fine until today.

I received an email message from Webassist that Design Extender had an update release. If I install this update, will this fix the problem or do I need to reinstall DataAssist first?

Thanks for your help,
Danielle

Sign in to reply to this post

Jason ByrnesWebAssist

any time you are getting javascript error's the first step is to Delete the Dreamweaver Cache file from the users configuration folder:
common_installation_issues.pdf

this screen shot is to small to read.

please compress the original screen shot into a zip archive and attach that to the response.

Sign in to reply to this post

turk361661

Followed your instruction. And it all worked perfectly!
Thank you, thank you for all your help!

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

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