Moving, Renaming, Copying, and Deleting Server Files

With cffile, you can create application pages to manage files on your Web server. You can use the tag to move files from one directory to another, rename files, copy a file, or delete a file.

The examples in the following table show static values for many of the attributes. However, the value of all or part of any attribute in a cffile tag can be a dynamic parameter. This makes cffile a very powerful tool.
Action
Example code
Move a file
<cffile action="Move"
  source="c:\files\upload\KeyMemo.doc"
  destination="c:\files\memo\"> 
Rename a file
<cffile action="Rename"
  source="c:\files\memo\KeyMemo.doc"
  destination="c:\files\memo\OldMemo.doc">
Copy a file
<cffile action="Copy"
  source="c:\files\upload\KeyMemo.doc"
  destination="c:\files\backup\">
Delete a file
<cffile action="Delete"
  file="c:\files\upload\oldfile.txt">

LiveDocs comments are not longer enabled for ColdFusion 5.0. Please use one of the following resources instead.

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 5.0