Skip to main content
Participating Frequently
December 14, 2017
Question

Contact form with ability up add CV / resume

  • December 14, 2017
  • 3 replies
  • 1224 views

Hi

I am building a website and the client would like a form on the site were people can send him a CV / resume.

I have built a basic form in Coldfusion, but this asks for name, email message etc. and sends this information as an email.

How do I create a extra bit that adds a pdf file to the email? How does this work?

Any simple/clear answers would be great

Many thanks

Mark

    This topic has been closed for replies.

    3 replies

    waudsAuthor
    Participating Frequently
    December 15, 2017

    Hi

    Well I think it is IIS version 8.5

    Not sure what web server logos are, or where they would be?

    Community Expert
    December 15, 2017

    Web server logs contain one line for every HTTP/HTTPS request. You can find the logs under C:\inetpub\logs\LogFiles\{webserverid} by default. You can find which ID belongs to which webserver in the IIS Management Console.

    Dave Watts, CTO, Fig Leaf Software

    Dave Watts, Eidolon LLC
    waudsAuthor
    Participating Frequently
    December 18, 2017

    Thanks for the reply. Unfortunately I don't fully understand.

    erm… so C:\ I know a have one of them on my computer, though I'm on a mac and it doesn't show the drive letters, but wouldn't it go to the server were my website is live?

    And I don't even know where to look for the IIS management console!!! 

    Arrhhh!

    Thanks
    Mark

    Inspiring
    December 14, 2017

    I'll add to the answer above (which shows how to attach the file to an email using <cfmailparam file="#form.whateverFileField#"/>).  If you need a local copy of the file for posterity, or want to do some basic checks to make sure you aren't mailing .exe files or whatnot, after your form post (be sure to set the encoding to "multipart/form-data") you can use <cffile/> to process the file:

    ColdFusion Help | cffile action = "upload"

    And based on results can provide error messages back to the user (such as PDF or size restrictions).

    -Nic

    WolfShade
    Legend
    December 14, 2017

    Yep, and if keeping hard drive space on the server is more important (I know some hosting services don't give that much space to client projects), you can use CFFILE action="READBINARY" to store the file in a variable, then use the variable as the content of the CFMAILPARAM.  In this case, the file is only saved to the TEMP directory, then deleted after the variable contains the binary.

    HTH,

    ^ _ ^

    WolfShade
    Legend
    December 14, 2017

    Oh, and one more thing.  If you can be sure that the users are all going to be using the latest browsers (no more than one or two versions behind current), you can use JavaScript file to check for file size, mimetype, etc., before the file is uploaded.  If you have the form set to have JavaScript submit the form, no one will be able to upload malicious files to your application/site.  Or, at least, it would become difficult to.

    V/r,

    ^ _ ^

    WolfShade
    Legend
    December 14, 2017

    Assuming that you are using CFMAIL to send the information, the resume would be attached using CFMAILPARAM inside the CFMAIL.

    HTH,

    ^ _ ^