Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFMAIL attachment? 1

Status
Not open for further replies.

RSedlacek

Programmer
Oct 5, 1998
59
0
0
US
I run a job posting site and have a simple form where job seekers can fill out to respond to a specific job offer that is automatically forwarded to the employer via CFMAIL. I would like to provide a means where the responder could attach their resume. Is this possible? If so, how?
 
You can use CFFILE to upload the file to the server:


You can then use CFMAILPARAM to attach the file to the e-mail:


Just be aware that you could be opening yourself to major problems here unless you limit the files that can be uploaded. If you send the files directly to the employer and they open a virus file, it's going to look bad for you.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Two additional follow-up questions...

1. I would prefer not to leave these uploaded files on the server. I guess I could go in and manually remove them periodically after they have been forwarded via email. Is it possible to have them deleted automatically after they are forwarded?

2. I certainly don't want to be unknowingly forwarding potentially virus-infected files to my customers. Is there a way to scan these files automatically before sending them on? Would limiting the uploading of files to only PDF, TXT and DOC file extensions be enough protection? I guess I could simply add a warning with each file sent that the user needs to run virus scans on these files before opening.
 
RSedlacek said:
1. I would prefer not to leave these uploaded files on the server. I guess I could go in and manually remove them periodically after they have been forwarded via email. Is it possible to have them deleted automatically after they are forwarded?

You could setup a schedule that checks for any files in the directory and deletes them if they are older than 1 day for example. When you are uploading them, make sure that you do it to a directory that is outside of the web accessible root.

RSedlacek said:
2. I certainly don't want to be unknowingly forwarding potentially virus-infected files to my customers. Is there a way to scan these files automatically before sending them on? Would limiting the uploading of files to only PDF, TXT and DOC file extensions be enough protection? I guess I could simply add a warning with each file sent that the user needs to run virus scans on these files before opening.

Your options here really depend on how much access to the server you have. If this is a local server, you could pass each file through a command prompt to an AV program before you send it, or you could have a pause in your code and then a realtime scanner checking that specific folder for new files. No matter how you do it, always include a prominent message that the user should scan the file for virus as even if you virus scan it some strains could still get through.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Wullie,

Thanks for the assistance. You have been most helpful.

Wullie said:
Your options here really depend on how much access to the server you have. If this is a local server, you could pass each file through a command prompt to an AV program before you send it, or you could have a pause in your code and then a realtime scanner checking that specific folder for new files. No matter how you do it, always include a prominent message that the user should scan the file for virus as even if you virus scan it some strains could still get through.

The site is located on a shared server, so my option are very limited. I guess I will try simply using a warning message with each file sent.

Thanks again for the help.

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top