CopyFile

When used before the Scan action, this action tells the Scan action to also copy the files to the specified location.

Syntax

bool CopyFile (StrParamSP)

Parameters

  1. The String value of the name of the target file system folder.
  2. Optional. The file extension you wish to use for each file. If you provide an extension, it must not be preceded by a period. The action defaults to .tif if this parameter is blank.

Smart parameters are supported.

Returns

Always True. If the target directory does not exist or if the files cannot be created, the files are not copied but the action still returns True.

Level

Any level but usually the batch level.

Details

A housekeeping action that copies the current source image file to a location that you specify and specifies the copied file's extension.

The source image file will remain in the input directory while a copy is placed into the specified directory. This action is typically used when it is desired to place images into a specific location for archiving. A copy of the image will still be placed into the batch directory as well.

If the target directory already contains a file of the same name, it will give a unique name to the new file.

This action must precede the Scan action. The CopyFile sets an indicator for the Scan action to copy the file. If CopyFile is used and the Scan action is never subsequently called, the copy will not be performed. The destination directory must already exist or a message will be logged and no files will be copied.

Example
CopyFile("C:\ParentDirectory\Application\Images\copies,tif")
Scan() 

This example copies the source image file to the copies folder and then adds it to the batch. It does not delete the image from the source folder.

CopyFile("@APPPATH(vscancopydir),tif")
Scan()

This variant example copies the source image file to the copies folder that was specified in the application service.