Using <CFFILE> to Manage and Create Files

The examples so far have illustrated <CFFILE>'s ability to handle file uploads, but the tag can also be used to manage and create files by using similar methods.

The attribute that alerts <CFFILE> that a file is being uploaded is ACTION="upload". When an upload ACTION is called for, other associated attributes further define the terms of the action (FILEFIELD, DESTINATION, and so on). Other ACTIONs have their own associated attributes, as listed in Table 18.2.

Table 18.2. ACTIONs Supported by <CFFILE>
ACTION What It Does Attributes Used with the ACTION
upload Uploads FILEFIELD to DESTINATION FILEFIELD, DESTINATION, ACCEPT, NAMECONFLICT
move Moves SOURCE file to DESTINATION SOURCE, DESTINATION, ATTRIBUTES ...

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.