This is my code to get the file from user and attach it to the mail.
<cfset destination = expandPath('Uploads/')>
<cffile action='upload' filefield='file_upload' destination='#destination#' result='upload' >
<cfmail to="id" from="id" subject="test">
<cfmailparam file="destination">
</cfmail>
When I run this I get an error, The resource destination was not found. Could you please help?
You can do some thing like this
<cfset destination = expandPath('Uploads/')>
<cffile action='upload' filefield='file_upload' destination='#destination#' result='upload' >
<cfmail to="#id#" from="#id#" subject="test">
<cfmailparam file="#destination#/#upload.serverFile#" >
</cfmail>
For more information you can see cfmailparan and cffile action="upload"