Adobe COLDFUSION 9 Manual page 824

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Sending custom response to the callback and error handlers
The page/URL that handles the upload operation on the server can send back a
message as shown here:
<cffile action = "upload"
destination = "#Expandpath('./upload')#"
nameconflict="makeunique">
<cfset str.STATUS = 200>
<cfset str.MESSAGE = "File Upload Successful"><cfoutput>#serializeJSON(str)#</cfoutput>
The following example illustrates the error handler:
<cftry>
<cffile action = "upload"
destination = "#Expandpath('./upload')#">
<cfcatch type="any">
<cfset str.STATUS = 500>
<cfset str.MESSAGE = "Error occurred while uploading the file">
<cfoutput>#serializeJSON(str)#</cfoutput>
</cfcatch>
</cftry>
If the user tries to upload a file already present in the upload directory, it results in an error. The status and message
are set to the specifications in the catch block.
Using styles
The attributes
headercolor
you style the file upload control.
The following example illustrates the styling of file upload control:
<cffileupload
url="uploadAll.cfm"
name="myuploader3"
align="right"
style="headercolor:silver;textcolor:1569C7;titletextalign:right;titletextcolor:black;bgcolor
:74BBFB;"/>
The following code shows how the attribute
,
,
,
textcolor
bgcolor
titletextalign
onUploadComplete
Last updated 8/5/2010
with the keys status and
struct
,
, and
titletextcolor
is used:
819
lets
rollovercolor

Advertisement

Table of Contents
loading

Table of Contents