Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 982

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
<!--- Save the thumbnail image to a file with the new filename. --->
<cfimage source="#myImage#" action="write"
destination="#newImageName#" overwrite="yes">
<cfoutput>
<p>
Thank you for uploading the image. We have created a thumbnail for
your picture.
</p>
<p>
<!--- Display the thumbnail image. --->
<img src="#getFileFromPath(newImageName)#">
</p>
</cfoutput>
</cfif>
<!--- If it is not a valid image file, delete it from the server. --->
<cfelse>
<cffile action="delete"
file="#fileUpload.serverDirectory#/#fileUpload.serverFile#">
<cfoutput>
<p>
The file you uploaded, #fileUpload.clientFile#, was not a valid image.
</p>
</cfoutput>
</cfif>
</cfif>
</cfif>
Generating a gallery of watermarked images
The following example extracts images and information from the
operations to perform the following tasks:
• Verify that an image exists for records returned from the database.
• Display the text, SOLD! on images that have been sold.
• Resize images to 100 pixels, maintaining the aspect ratio of the source image.
• Add a 5-pixel border to the images.
• Display the modified images directly in the browser without writing them to files.
cfartgallery
Last updated 1/20/2012
database. You use ColdFusion image
977

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents