I'm working on a page which collects information entered on a form
by a user and sends it via email to a specified email address. I
want to add a field to allow the user to upload one file, I want
the file to be sent as an attachment with the email.

This will be happening on a Cold Fusion MX (v6.1) server running
IIS on a Win2K Server platform. I'm testing on CFMX 6.1 running
Apache2, also Win2K Server. The host has announced an intention
to upgrade to CFMX 7 but funding issues, yada. It could be a while.

Anyway, during testing the file uploads to the server but then
the script throws an error on the cfmailparam tag (line 24).

According to livedocs, cfmailparam wants a real file name but I
want to preserve the existing file name as a variable and use
that original file name as the attached file name. My attempts
to do so have all failed, so far. What am I doing wrong?

The relevant CF script, below. I had some help getting this far,
the guy who helped has no clue at this point either.

Reese





This is the processing script, when it completes it redirects to a
"thank you" page. I munged the path statements on lines 2 and 24,
also the email addresses on lines 9 and 10, for this email.

1. <cfif isDefined('mailAttachment') and Trim(mailAttachment) is not "">
    </cfif>
2. <cffile  destination     ="[path]\contact\attachments\"
3.          action          ="upload"
4.          nameconflict    ="MakeUnique"
5.          filefield       ="mailAttachment">
6.
7.
8.
9. <cfmail from             =<mailto:[EMAIL PROTECTED]>"[EMAIL PROTECTED]"
10.        to               =<mailto:[EMAIL PROTECTED]>"[EMAIL PROTECTED]"
11.        replyTo          ="#form.eMailAddy#"
12.        subject          ="Inquiry from #form.Name#
13.        mailerID         ="Mailer 1.0"
14.        type             ="text"
15. >
16.
17.
18. Name:               #form.Name#
19. E-Mail Addy:        #form.eMailAddy#
20.
21. Comments:           #form.comments#
22.
23. <cfif Trim(form.mailAttachment) is not "">
24. <cfmailparam file="[path]/contact/attachments/#form.mailAttachment#">
</cfif>
25. </cfmail>
26.
27. <cflocation url="./thankyou.cfm?fn=#form.Name#">
28.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1148
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to