OK, I'm working on an online job application form. Once the form is completed a copy of the form is e-mailed to the appropriate address. The form also includes the ability for the user to browse for a file (resume) on their local machine and have it uploaded and attached to the e-mail... that's the goal anyway.
I've got the form built and the e-mail function works, but I can't get the file to attach to the e-mail. The files are being uploaded... I can find them in the upload directory.
This is the file code for allowing the user to choose the file to upload:
<input type="file" name="resume" value="" size="45">
This is the code before the CFMAIL tag relating to the attachment:
This is the code within the CFMAIL tags that is being used to attach the file:
This is the error I get when I attempt to include an attachment:
That path is correct (it works for uploading the file) and the file does indeed exist. I can FTP out to the site after attempting to submit the form and find it in the uploads folder.
I also tried using "mimeattach=" to attach the files, but that results in the same error. Same with using the absolute path instead of the relative path for the location of the file... the same "File not found" error results.
So I'm stumped. Any ideas?
So what's going on here? Why
I've got the form built and the e-mail function works, but I can't get the file to attach to the e-mail. The files are being uploaded... I can find them in the upload directory.
This is the file code for allowing the user to choose the file to upload:
<input type="file" name="resume" value="" size="45">
This is the code before the CFMAIL tag relating to the attachment:
CF_FileUpload is a secure form of CFFILE... CFFILE has been disabled by our host.<cfset attachment_directory = "/example_com/www/new/uploads">
<cfif form.resume neq "">
<CF_FileUpload userid="xxxxxx" password="xxxxx" action="upload" filefield="resume" destination="#attachment_directory#" nameconflict="Makeunique">
<cfset attachment_resume = "#attachment_directory#/#cffile.serverfile#">
</cfif>
This is the code within the CFMAIL tags that is being used to attach the file:
<cfsilent>
<cfif form.resume neq "">
<cfmailparam file="#attachment_resume#">
</cfif>
</cfsilent>
This is the error I get when I attempt to include an attachment:
Error Diagnostic Information
Unable to attach file.
Cannot attach '/example_com/www/new/uploads/example.doc' to the mail message. The file does not exist.
That path is correct (it works for uploading the file) and the file does indeed exist. I can FTP out to the site after attempting to submit the form and find it in the uploads folder.
I also tried using "mimeattach=" to attach the files, but that results in the same error. Same with using the absolute path instead of the relative path for the location of the file... the same "File not found" error results.
So I'm stumped. Any ideas?
So what's going on here? Why
