FileCopy

Copies a file from one location to another.

The destionation can be a file or a directory. If the destination is a directory, the source file name will be appended to the destination.

Method Signature

FileCopy(source=[string], destination=[string], createPath=[boolean], overwrite=[boolean], accept=[string])

Arguments

Argument
Type
Required
Description
Default

source

string

true

The source file

destination

string

true

A destionation file or directory, if it's a directory, the suorce file name will be appended

createPath

boolean

false

[ true ] whether to create any nested paths required to the new file

true

overwrite

boolean

false

Whether to overwrite the destination file if it exists. Defaults to true.

true

accept

string

false

A comma separated list of file extensions to accept - which will override runtime security settings

Examples

Copy file from here to there

fileCopy( sourceFile, destinationFile );

Additional Examples

fileCopy( "path/to/my/file.md", "new/location/for/file.md" );

Last updated

Was this helpful?