close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Email Attachment Woes

Thread began 10/18/2009 5:41 pm by paputxi | Last modified 10/19/2009 4:14 pm by paputxi | 2887 views | 7 replies |

paputxi

Email Attachment Woes

I am having great difficulties in creating an online form where a visitor can attach a file from their computer that is then emailed to me. In trying to troubleshoot the problem, I created an empty website that I then populated with just the WA Contact Form Solution Pack files. I then modified the contactus.php file by adding a file field element at the top of the form per the WA "Inserting Additional form fields to your Contact Form". I then followed the directions of WA's "How To Include Attachments with your Email form" to indicate the Server Directory and Server File Name entries. I also created a folder in my website, "attachments", and added that to the path for these two entries.

However, this did not work, so I then tried removing the Server Directory entry as identified in the Debugging section of "include" paper. That too, did not work. I also tried NOT specifying the "attachments" folder for the above mentioned server directory and file name combinations, but they too did not work. (Note: Each time I made a change, I uploaded the whole site to make sure I wasn't missing a file somewhere. Note too, that I do get the text fields in the emails I receive, just not the attached file.

I'm enclosing the contactus.php and associated WAUE_contact_1.php files in hopes that someone can see what I am doing wrong. Any thoughts on how I correct this would be greatly appreciated. Thanks in advance.

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

Jason ByrnesWebAssist

In the WAUE_contact_1.php file, line 25:


php:
$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"attachments/".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverDirectory"]  ."".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."");




should be:

php:
$WA_MailObject = WAUE_AddAttachment($WA_MailObject, "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverDirectory"]  ."".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."");




If you are still having problems, lets make sure the server file name is being set. Change line 25 to:

php:
die("".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverDirectory"]  ."".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."");

  $WA_MailObject = WAUE_AddAttachment($WA_MailObject, "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverDirectory"]  ."".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]  ."");





This will write the server file name and upload folder to the screen, post this value back.

Sign in to reply to this post

paputxi

Didn't work, so I ran your last code. Results provided below. Also, in case it helps you, attached is the HelperPHP.php file.

Warning: mkdir() [function.mkdir]: No such file or directory in D:\Hosting\4491668\html\CFSP2\WA_DigitalFilePro\HelperPHP.php on line 30

Warning: move_uploaded_file(D:/Hosting/4491668/html/CFSP2/contactus.php/attachments\44bcfc577e25e2c6258bd82b1b07f5d0_tmp.doc) [function.move-uploaded-file]: failed to open stream: No such file or directory in D:\Hosting\4491668\html\CFSP2\WA_DigitalFilePro\HelperPHP.php on line 96

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'D:\Temp\php\php5523.tmp' to 'D:/Hosting/4491668/html/CFSP2/contactus.php/attachments\44bcfc577e25e2c6258bd82b1b07f5d0_tmp.doc' in D:\Hosting\4491668\html\CFSP2\WA_DigitalFilePro\HelperPHP.php on line 96

Warning: copy(D:/Hosting/4491668/html/CFSP2/contactus.php/attachments\44bcfc577e25e2c6258bd82b1b07f5d0_tmp.doc) [function.copy]: failed to open stream: No such file or directory in D:\Hosting\4491668\html\CFSP2\WA_DigitalFilePro\HelperPHP.php on line 98

Attached Files
HelperPHP.zip
Sign in to reply to this post

Jason ByrnesWebAssist

That basically means the upload directory does not exist and there are no privlages t ocreate it.



Try changing line 33 of the contact us page:

'UploadFolder' => "/attachments",


to:
'UploadFolder' => "attachments",



and make sure that there is a folder called "attachments" in the same folder as the contact us page.

Sign in to reply to this post

paputxi

Success!! Using your debugging techniques (which gave me more insight as to what was happening, or in this case NOT happening) and setting the permission to the attachments folder on the website to be "read-write" (BIG part of the problem, for sure), I was able to resolve the problem. Thanks for your support on this, Jason! You can mark this issue RESOLVED.

Sign in to reply to this post

Jason ByrnesWebAssist

excellent, glad to hear it's working.

Sign in to reply to this post

paputxi

Turns out it is "almost" working. Now I need to get it to accept .doc file types (which is what I need) and not just.jpg files (which is what I was testing with). Unless you have a suggestion regarding that, I'll go over to the Digital File Pro forum to see what I can find out.

But, you were a big help, Jason. Thanks again.

Sign in to reply to this post

paputxi

Never mind. It appears to be working just fine now.

Thanks once again for your support, Jason.

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