close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Digital Fire Pro and Contact Form

Thread began 2/24/2010 9:16 am by paul250682 | Last modified 3/08/2010 5:25 pm by Eric Mittman | 1465 views | 7 replies |

paul250682

Digital Fire Pro and Contact Form

I have some working forms created from Contact Form Solution Pack and I would like to add some file upload fields to these forms. In particular I need the following features:
- uploaded files to be stored on the server
- uploaded image files to be resized
- progress bar to show upload progress
- data input via the form, other than uploaded files, to be included in an email (as per contact form solution pack)
- uploaded files to be easily identifiable with the email sent by the same form.

Prima facie it looks as if Digital Fire Pro can do all of this but from a quick look at the forums it seems this may not be quite so easy in practice.

Can anyone advise on their practical experience of combining Digital Fire and Contact Form?

Many thanks

Sign in to reply to this post

Eric Mittman

All the things that you mention can be accomplished by using Digital File Pro in the contact form.

Here are the basics about what you will need to do to get this working.

First, you need to add the file fields to your form, there should be one for each upload you would like to have occur.

Next you need to update the form tag, it must include this attribute in it:

html:
enctype="multipart/form-data"



After this you will add in the Digital File Pro server behaviors for the uploads. For the trigger you should choose same page post. You will configure the upload server behavior how you will need it, you can specify the directory and any resizing that you would need.

You will then add in the progress bar by selecting the form on the page and going to insert > webassist > digital file pro > progress bar, or you can click on the progress bar button in the webassist insert panel.

The very last part of this would be to modify the email message for the contact form to add in the filenames of the files that were uploaded. This part will require a little bit of custom coding since it is designed to show form element names and values. I can show you what needs to be done in this part when you get to it, just let us know.

Sign in to reply to this post

paul250682

Many thanks for your help.

I have followed your instructions and successfully added the file fields (the files upload correctly to the selected folder on the server) and also added the progress bar.

I would be grateful for your guidance on the coding changes needed to modify the email message generated by the contact form to show the file names of the uploaded files.

Sign in to reply to this post

Eric Mittman

To make these edits you need to go into WA_Unisersal_Email > Templates > contactus.php and update the code on near line 10 that looks like this:

php:
if ($pval != "" && strpos($pkey,"Security_") !== 0 && $pkey != "x" && $pkey != "y")  {



In here you need to add an exception for the file field you have, you would add it in like this:

php:
if ($pval != "" && strpos($pkey,"Security_") !== 0 && $pkey != "x" && $pkey != "y" && strpos($pkey,"<your file field name here>") !== 0")  {



Next you will need to add in a reference to the server file name of the file you uploaded, you should be able to just drag and drop the binding for the uploaded file onto this page, it should look like this for the server file name:

php:
<?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>



If you have any trouble with this post back with the contactus template file and your modified contact form page and let us know what the trouble is.

Sign in to reply to this post

paul250682

I am having trouble dealing with the last step (...."to add in a reference to the server file name of the file you uploaded .....") which is a result of my limited knowledge of php coding for which I apologise.

I'm not really sure how or where to add the code for this step into the contactus.php file and your guidance would be much appreciated. I have attached zip files of the two files I am working on.

Also, I am not sure if I am correct Eric, but I think there may be an error in the code you gave for adding an exception for the file field in that the final part of the code, ie !== 0") does not require the double quotes? - but as I said my knowledge of php coding is limited!

Thanks

Attached Files
contact_styled_test.zip
contactus.zip
Sign in to reply to this post

Eric Mittman

No need to apologize for lack of coding knowledge, with some more experience I'm sure you will be an expert soon enough.

Good catch with the extra double quote in there, it will definitely cause problems, you can just remove it after the 0.

As for where to put the binding for your upload you would add this into the WA_Universal_Email > Templates > contactus.php page below the loop like this:

php:
19: ?><?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>

20:    </div>
21: </body>
22: </html>
Sign in to reply to this post

paul250682

Works fine now. Thank you.

Sign in to reply to this post

Eric Mittman

Glad to hear that, let us know if you have any further questions.

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