Skip to main content
Participating Frequently
Dec 14, 2017 2:53 PM UTC
Question

Contact form with ability up add CV / resume

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 is closed to new replies. Start a new post to keep the conversation going.

    13 replies

    waudsAuthor
    Participating Frequently
    Dec 15, 2017 3:55 PM UTC

    Hi

    Well I think it is IIS version 8.5

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

    Translate
    Community Expert
    Dec 15, 2017 4:11 PM UTC

    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

    Translate
    Dave Watts, Eidolon LLC
    waudsAuthor
    Participating Frequently
    Dec 18, 2017 12:19 PM UTC

    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

    Translate
    Inspiring
    Dec 14, 2017 3:44 PM UTC

    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

    Translate
    WolfShade
    Legend
    Dec 14, 2017 4:00 PM UTC

    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,

    ^ _ ^

    Translate
    WolfShade
    Legend
    Dec 14, 2017 4:06 PM UTC

    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,

    ^ _ ^

    Translate
    WolfShade
    Legend
    Dec 14, 2017 3:24 PM UTC

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

    HTH,

    ^ _ ^

    Translate