• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfmail: attach file with cfmailparam?

Guest
Jan 25, 2013 Jan 25, 2013

Copy link to clipboard

Copied

Greetings

I created a form several years ago that allows users to submit maintenance requests. They check a box if they want a receipt sent to their own email.

The requests do not get captured in a DB- simply sends to email.

This all has been working fine- I am now attemping to add document attachment capability- I am obviously not using the correct method.

The form itself has:

<cfform action="request_action.cfm" method="post" name="detail" id="detail" enctype="multipart/form-data">

etc. etc.

Upload File or Sceenshot if neccessary: <cfinput name="file_upload" type="File" required="no" size="40"></cfform>

The request_action.cfm has:

<cfmail to=

etc. etc.

<cfif isDefined("Form.file_upload") >

    <cfmailparam 

        contentID = "file_upload"

        disposition = "attachment"

        file = "#Form.file_upload#" 

        type ="application/msword,application/docx,application/pdf,application/octet-stream,application/msword,text/plain,binary/octet-stream, image/pjpeg,  image/gif, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-word.document.12, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"></cfif>

</cfmail>

When I run without the above code, everything works. When I run with the cfmailparam, it sends a strange receipt with no content?

Thanks for any help with this

Norman

TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2013 Jan 26, 2013

Copy link to clipboard

Copied

LATEST

You didn't post any code that shows that you actually uploaded the file to your server. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation