Whatever message this page gives is out now! Go check it out!
FileCopy(source, destination) |
Parameter | Description |
source | Pathname of the on-disk or in-memory file to copy. If not an absolute path (starting with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, which is returned by the getTempDirectory function. |
destination | Pathname of an on-disk or in-memory directory or file on the web server where the file is copied. If you specify a filename without a directory path, ColdFusion copies it relative to the source directory. |
ram:///filepath |
<h3>FileCopy Example</h3>
<cfset sourcefile="c:\testingdir\test1.txt">
<cfset destinationfile="c:\productiondir\test2.txt">
<cfif FileExists(#sourcefile#)>
<cfif FileExists(#destinationfile#)>
<cfoutput>A copy of #destinationfile# already exists.</cfoutput>
<cfelse>
<cfscript>
FileCopy(#sourcefile#, #destinationfile#);
</cfscript>
<cfoutput>Copied: #sourcefile# <br>
To: #destinationfile#</cfoutput><br>
</cfif>
<cfelse>
<cfoutput>The source file does not exist.</cfoutput><br>
</cfif>