Reading and Writing with <CFFILE>

<CFFILE>'s read and write ACTIONs enable you to work with plain-text files on your server. They enable you to extract data from text files and to create new text files to hold data a template has obtained from a variable or a query.

Note

<CFFILE>'s read and write ACTIONs work only with plain-text, or ASCII files. They will not work with proprietary, binary formats such those in word-processing documents. A special ACTION, readbinary, will read binary files into a binary ColdFusion object—check your ColdFusion documentation if you need to use this advanced feature.

The Read ACTION

Say that a user has uploaded a plain-text file that details her most recent alien encounter. Using <CFFILE>, you could read this file ...

Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.