Adobe COLDFUSION 9 Manual page 1223

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
• The name of the query to hold the information about the returned attachments. When the tag completes
processing, the query object contains one record for each retrieved attachment. The query has six columns that
contain the filename, complete path to the saved attachment file, MIME type, file size, CID value (or an empty
string) and an indicator that shows whether the attachment is a message.
• The path where the attachment is saved. (If you omit the path, ColdFusion does not get the attachments, but does
get the information about the attachments.)
• Optionally, whether to create unique filenames by appending numbers to the names when two or more attachments
have the same names. (The default is to not create unique filenames.)
The following ColdFusion Exchange tag gets all attachments to the message identified by the
them in the C:/temp/cf_files/attachments directory, and stores information about the attachments in the
structure:
<cfexchangemail action="getattachments"
connection="myconn1"
uid="#theUID#"
name="#attachInfo#"
attachmentPath="C:/temp/cf_files/attachments"
generateUniqueFilenames="true">
To get message attachments, you must have the UID of the message and know that the message has attachments. Use
a ColdFusion Exchange tag, such as
tag completes processing, the query specified by the
• The
field is
HasAttachments
• The
field contains the Exchange UID of the item. The exact UID format depends on the type of item; event,
UID
contact, message, or task.
You can use these fields in your decision logic that determines whether to get attachments for a message and
determines the message UID.
The following example gets the attachments to all mail messages from docuser2 in the last week. It places each
message's attachments in a directory whose name is the hexadecimal part of the message UID. For each message with
attachments, the application reports subject and date of the message, followed by a table listing the message's
attachments. The table includes the attachment name, MIME type, and size.
Notice that if a message has multiple attachments with the same name, the attachment information query always lists
the attachments with their original, duplicate names, even if you specify generateUniqueFilenames="true". The
generateUniqueFilenames attribute only affects the names of the files on disk. The
the attachment information structure does have the unique filenames, however.
, with the
cfexchangemail
attribute includes the following columns:
name
if a message has one or more attachments
true
Last updated 8/5/2010
action to determine this information. When the
get
attachmentFilePath
1218
variable, saves
theUID
attachInfo
column of

Advertisement

Table of Contents
loading

Table of Contents