You can find the CFFiddle demo of this function and other file functions as part of a project that is shared with you.
Click the button below to launch CFFiddle.
To copy the project in your workspace in CFFiddle, follow the steps below:
Moves an on-disk or in-memory file from one location to another on the server.
ColdFusion 8: Added this function.
FileMove(source, destination) |
FileClose, FileCopy, FileOpen, FileRead, FileReadLine, FileWrite, cffile
ColdFusion 8: Added this function.
Parameter |
Description |
|---|---|
source |
Pathname of the on-disk or in-memory file to move. 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 the destination on-disk or in-memory directory or file. If not an absolute path, it is relative to the source directory. |
Use the following syntax to specify an in-memory file, which is not written to disk. In-memory files speed processing of transient data.
ram:///filepath |
The filepath can include directories, for example ram:///petStore/images/poodle.jpg. Create the directories in the path before you specify the file. For more information on using in-memory files, see Working with in-memory files in the Developing ColdFusion Applications.
The following example moves the test1.txt file from the c:\testingdir\ directory to the c:\productiondir\ directory in Windows and renames the file test2.txt:
<h3>FileMove Example</h3>
|
Sign in to your account