LassoScript Utility
Basics Browse Detail


Tag Link [File_Copy] Category File
Type Process Source Available No
Support Preferred Version 3.0
Change Unchanged Data Source Any
Output Type None Security Tag, File
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x


[File_Copy] copies a file or directory from one location to another. Accepts two parameters, the location of the file or directory to be copied and the new location. Optional -FileOverWrite keyword specifies that the destination file should be overwritten if it exists.

The file tags are protected by four different permissions. The user must have permission for all of the following in order to use this tag:
- Permission to use the tag itself.
- Permission to perform the file operation.
- Permission to work in the directory which contains the files.
- The filename extensions of the files which are being worked with must be allowed in Lasso Administration.


[File_CopyFile NameDestination File Name]

[File_CopyFile NameDestination File Name-FileOverwrite]


Required Parameters
File Name The name of the file to be copied.
Destination File Name The name of the destination for the copy.
Optional Parameters
Overwrite Keyword If specified, instructs Lasso to overwrite an existing file at the destination.


To copy a file from one location to another:

Use the [File_Copy] tag. The following example copies a file named myfile.txt from the root of the Web serving folder into a folder named LogFiles.

    File_Copy: '/myfile.txt', '/LogFiles/myfile.txt';
    Output: (File_CurrentError: -ErrorCode) + ': ' + (File_CurrentError);

0: No Error