Detailed instructions for use are in the User's Guide.
CFML Language Reference
ColdFusion 4.5
Allaire Corporation
Copyright Notice
© 1999 Allaire Corporation. All rights reserved. This manual, as well as the software described in it, is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this manual is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by Allaire Corporation. Allaire Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear in this book. Except as permitted by such license, no part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written permission of Allaire Corporation. ColdFusion and HomeSite are federally registered trademarks of Allaire Corporation. HomeSite, the ColdFusion logo and the Allaire logo are trademarks of Allaire Corporation in the USA and other countries. Microsoft, Windows, Windows NT, Windows 95, Microsoft Access, and FoxPro are registered trademarks of Microsoft Corporation. All other products or name brands are the trademarks of their respective holders. Solaris is a trademark of Sun Microsystems Inc. UNIX is a trademark of The Open Group. PostScript is a trademark of Adobe Systems Inc.
Part number: AA-45LNG-RK
Contents
Preface: Welcome To ColdFusion ................................................................xiii
Intended Audience.........................................................................................................................xiv Welcome to the ColdFusion 4.5 Web Application Server ...........................................................xiv Products and System Requirements ............................................................................................xiv New features in ColdFusion 4.5 .....................................................................................................xv New visual tools ......................................................................................................................xvi Enhancements to CFML ........................................................................................................xvi Better reliability ......................................................................................................................xvi Improved performance.........................................................................................................xvii Enterprise connectivity features ..........................................................................................xvii Security enhancements....................................................................................................... xviii Language Reference Features .......................................................................................................xix Using Examples ......................................................................................................................xix Using Code Snippets ..............................................................................................................xix Using End Tags................................................................................................................................xx Developer Resources ......................................................................................................................xx About ColdFusion Documentation ..............................................................................................xxi Documentation updates ........................................................................................................xxi ColdFusion manuals ..............................................................................................................xxi ColdFusion Server online documentation ..........................................................................xxii Printing ColdFusion documentation...................................................................................xxii Documentation conventions.............................................................................................. xxiii Getting Answers .......................................................................................................................... xxiii Contacting Allaire ................................................................................................................ xxiii
Chapter 1: ColdFusion Tags.............................................................................1
Alphabetical List of ColdFusion Tags ............................................................................................. 2 New Tags in ColdFusion 4.5 ............................................................................................................ 5 ColdFusion Forms Tags................................................................................................................... 6 Database Manipulation Tags .......................................................................................................... 6 Data Output Tags ............................................................................................................................. 6 Exception Handling Tags ................................................................................................................ 6 Extensibility Tags ............................................................................................................................. 7 File Management Tags..................................................................................................................... 7
iv
CFML Language Reference
Flow-Control Tags ............................................................................................................................7 Internet Protocol Tags ......................................................................................................................7 Java Servlet and Java Object Tags ....................................................................................................8 Variable Manipulation Tags.............................................................................................................8 Web Application Framework Tags ..................................................................................................8 Other Tags .........................................................................................................................................8 CFABORT...........................................................................................................................................9 CFAPPLET........................................................................................................................................11 CFAPPLICATION ............................................................................................................................13 CFASSOCIATE .................................................................................................................................16 CFAUTHENTICATE ........................................................................................................................17 CFBREAK .........................................................................................................................................19 CFCACHE ........................................................................................................................................20 CFCOL..............................................................................................................................................23 CFCOLLECTION .............................................................................................................................25 CFCONTENT ...................................................................................................................................28 CFCOOKIE .......................................................................................................................................30 CFDIRECTORY................................................................................................................................33 CFERROR.........................................................................................................................................36 CFERROR Error Variables .......................................................................................................37 CFEXECUTE ....................................................................................................................................40 CFEXIT .............................................................................................................................................42 CFFILE .............................................................................................................................................45 CFFILE ACTION attributes .....................................................................................................46 CFFILE ACTION="Upload"............................................................................................................47 Evaluating the results of a file upload....................................................................................49 CFFILE ACTION="Move"...............................................................................................................51 CFFILE ACTION="Rename" ..........................................................................................................52 CFFILE ACTION="Copy" ...............................................................................................................53 CFFILE ACTION="Delete" .............................................................................................................54 CFFILE ACTION="Read"................................................................................................................54 CFFILE ACTION="ReadBinary".....................................................................................................55 CFFILE ACTION="Write" ...............................................................................................................55 CFFILE ACTION="Append" ...........................................................................................................58 CFFORM ..........................................................................................................................................59 Incorporating HTML form tags ..............................................................................................60 CFFTP ..............................................................................................................................................63 Establishing a Connection with CFFTP .................................................................................63 File and Directory Operations with CFFTP ...........................................................................66 CFFTP.ReturnValue Variable..................................................................................................70 Accessing the Columns in a Query Object ............................................................................70 Connection Caching ...............................................................................................................71 CFGRID............................................................................................................................................73 Select mode and form variables .............................................................................................78 Using SELECTMODE="Edit"..................................................................................................78 Using the HREF attribute........................................................................................................78 CFGRIDCOLUMN...........................................................................................................................81 CFGRIDROW ...................................................................................................................................86 CFGRIDUPDATE.............................................................................................................................87
Contents
v
CFHEADER ......................................................................................................................................90 CFHTMLHEAD................................................................................................................................91 CFHTTP ................................................................................................. ...