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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFMAIL / CFFILE attachment error

Status
Not open for further replies.

evie71

MIS
Nov 14, 2002
6
GB
Hi,
I have spent ages checking the forum for this solution, AND tried all of your suggestions..but I am still getting TMP filenaming problems! I.E the server will upload the file absolutely fine. I can do a check using file.serverfile and see it is there...but Cfmail will NOT attach the uploaded file!
I can't beleive how straightforward this should be!! I have spent too long on this now...please any help would be appreciated before I go mad.

Error message: "The resource CDU files.doc was not found.
The root cause was: null."

I want to create a form that allows user to upload file from local or network machine.. I then use CFFILE to upload this to the CF server in c:\temp. I then want to grab this file from C:\temp and attach using CFMAIL and CFMAILPARAM FILE=""
I am using CF MX on Windows 2000.

In a previous post, someone suggested that using CFPARAMMAIL with #file.serverfile# was all that was required. Well I have tried this and I still get an error because it only recognises the file as "neotmp7681.tmp"!!?

My form code:

<form action=&quot;../../../../cfusion/Forms/upload.cfm&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;>
<input type=&quot;file&quot; name=&quot;filepath&quot;>
<input type=&quot;submit&quot;>
</form>

Form action page:


<CFFILE
action=&quot;upload&quot;
nameconflict=&quot;overwrite&quot;
filefield=&quot;filepath&quot;
destination=&quot;c:\temp&quot;>

<CFOUTPUT>
<cfset fileUploaded = #file.serverfile#>
Uploaded File:#fileUploaded#

<cfset filename = GetFileFromPath(Form.filepath)>
<br>filename= #filename#
</CFOUTPUT>

<cfmail to=&quot;xxx@xxx.xxx&quot; from=&quot;extranet@xx.xxx&quot; subject=&quot;File attachments Test&quot; type=&quot;HTML&quot;>
<cfmailparam file=#file.serverfile#>
</cfmail>

Please any pointers?
Thanks
Emma

 
Try using the mimeattach attribute in the cfmail tag, instead of the cfmailparamtag!

E.G. <CFFILE
action=&quot;upload&quot;
nameconflict=&quot;overwrite&quot;
filefield=&quot;filepath&quot;
destination=&quot;c:\temp&quot;>

<cfset attachment=&quot;#file.ServerDirectory#/#File.ServerFile#&quot;>

<cfmail to=&quot;xxx@xxx&quot; from=&quot;xxx@xxx&quot; subject=&quot;something&quot; MIMEATTACH=&quot;#attachment#&quot;>
 
Thank you SO much!
Of course it works...dont know why I didnt try that! :)
 
Please advise what is mimeattach term in cfmail?

I have heard of mime but not sure what it is?

Also, a smtp address is a mail server address?
 
this post was 2 years ago. are you having similar problems?

mimeattach is an alternative to <cfmailparam> i think.

smpt: (from pcwebopedia.com)
(pronounced as separate letters) Short for Simple Mail Transfer Protocol, a protocol for sending e-mail messages between servers. Most e-mail systems that send mail over the Internet use SMTP to send messages from one server to another; the messages can then be retrieved with an e-mail client using either POP or IMAP. In addition, SMTP is generally used to send messages from a mail client to a mail server. This is why you need to specify both the POP or IMAP server and the SMTP server when you configure your e-mail application.

mime: (from pcwebopedia.com)
Short for Multipurpose Internet Mail Extensions, a specification for formatting non-ASCII messages so that they can be sent over the Internet. Many e-mail clients now support MIME, which enables them to send and receive graphics, audio, and video files via the Internet mail system. In addition, MIME supports messages in character sets other than ASCII.
There are many predefined MIME types, such as GIF graphics files and PostScript files. It is also possible to define your own MIME types.

In addition to e-mail applications, Web browsers also support various MIME types. This enables the browser to display or output files that are not in HTML format.

MIME was defined in 1992 by the Internet Engineering Task Force (IETF). A new version, called S/MIME, supports encrypted messages.


A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top