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

rating

Multiple Uploads

Thread began 6/14/2012 1:11 am by Vikingbear | Last modified 6/20/2012 6:09 pm by Vikingbear | 1776 views | 10 replies |

Vikingbear

Multiple Uploads

Hi,

I have a form where I want to upload a file to /dir1/ and a second file to /dir2/
I am triggereing both uploads (+ the rest of the form data to email) with the form SUBMIT button..
The first file uploads fine, the second never uploads? is that because it is not possible to do this? or am I simply doing something wrong..
I am not planning to attach a database for this..

also, is there a way to list the 2 filenames in the text data sent to the email address, so the receipient knows what files to look for when he goes in to /dir1/ and /dir2/

Ideally I would have liked to send the files along with the email data, rather than just upload, but I have given up on that :)

Any pointers are greatly appreciated!

Regards, Ken

Sign in to reply to this post

Jason ByrnesWebAssist

It could be that a php error is preventing the second file from uploading. add the following code at line 1 to turn on error reporting:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>



are you using 2 separate file uploads?

For the File Name, go to the bindings panel and expand the WA Uploaded Files (File Field) Binding group.

If you have 2 separate uploads there will be a binding group for each file field.

This binding group will contain a binding called Server File Name, this binding can be added to the email message to show the name of the uploaded file.

If you wish to attach the uploaded file, edit the Universal Email server behavior. On the Attachments section add a new attachment and select the enter value option. click the lightning bolt to open the bindings panel and expand the first WA Uploaded Files binding group. Select the Server Directory binding and copy the code for the server directory, then select the server file name binding. past the server directory code in front of the server file name code.

Repeat this for the second file upload.


send a copy of your page so I can see how the upload is configured.

Sign in to reply to this post

Vikingbear

Multiple Uploads

Hi, Jason

I am afraid most of the explanation was too 'technical' for me.. I usually let Dreamweaver do my coding (a cheat, I know)

I have attached the file I am working on as you suggested.. (it is a .php file, but I had to rename to upload)

I am happy with an upload solution if a attac solution is too complex..

let me know if you can see any glaring issues.. Much appreciated

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

Jason ByrnesWebAssist

I see 5 upload file behaviors on this page.

2 of them are set to upload to the cv/ folder, 2 are set to upload to the rsa/ folder. and one is set to use the validated entries binding for the folder name.

I would remove them all and start from fresh, and only have the 2 upload behaviors in please. The additional behaviors are causing the issue.

to write the file names in the email, you will need to open the bindings panel, and expand the WA Uploaded Files binding group, and add the Server File Name binding to the email message.

Sign in to reply to this post

Vikingbear

Multiple Uploads

Hi, Jason

Did not realise I was ADDING entries as I was modifying.. Thanks for the heads up..
I started form scratch as suggested, I now have 2 upload fields, 2 upload directories and the upload works fine.. THANKS..
However, your explanation about adding the file name to email is above my skill set I think

"to write the file names in the email, you will need to open the bindings panel, and expand the WA Uploaded Files binding group, and add the Server File Name binding to the email message."

This is what I added below each upload field:
<input name="CV File Name" type="hidden" value="<?php echo $WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]; ?>" />

But that did not work? any ideas? :) appreciate you time..!!

Sign in to reply to this post

Jason ByrnesWebAssist

adding a for element to the page will not work.

the server file name binding code needs to be added to the email body.

In Universal Email, did you select to use a template for the email message?

If so, you need to copy the server file name binding code:
File 1: <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?><br />
File 2: <?php echo $WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]; ?><br />

into the email template file where the file name should be displayed.

Sign in to reply to this post

Vikingbear

Hi, Jason

I have tried to add the 2 lines of code you gave me to my 'univaersal email file' WAUE_Careers.php but I get coding syntax errors? and PHP errors when I run the script..
I suspect that by template you mean this file as it formats the text in the resulting email..

Sorry to bug you again, but I am stuck..

Regards, Ken

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

Jason ByrnesWebAssist

Ok, so you are using the DW Edit button to create your email message, not using the option to create a file for the email.


So, edit the Universal Email instance, click the DW Edit button to edit the email body, then paste the code I gave you into the email body.

Sign in to reply to this post

Vikingbear

Multiple Downloads

Jason,
I did enter the snippets into theUniversal Emial (tried in a number of locations) but I get code errors..
I do not know what the DW Edit Button is nor could I find one?

I have tried adding the code as a hidden field in the PHP form and I have tried to add the code you gave me to the universal php that actually builds and formats teh resulting email..
but I get code errors..(syntax errors)
$MailBody = $MailBody . "<?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>\r\n";

Where do I go from here?

Sign in to reply to this post

Jason ByrnesWebAssist

this line:
$MailBody = $MailBody . "<?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>\r\n";


should be:
$MailBody = $MailBody . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]."\r\n";

Sign in to reply to this post
loading

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