FileCopy (Dundas Upload Control 2.0)

Dundas

FileCopy (Dundas Upload Control 2.0)

Overview | Properties | Methods

Call this method to copy a file from a specified source to a specified destination at the server.

Syntax

UploadObject.FileCopy (Source As String, Destination As String[, FailIfExists As Boolean = TRUE]

The FileCopy method syntax has the following parts:

Part

Description

Source

The name of the file to be copied. Use either a relative or absolute pathname, depending on the setting of the UseVirtualDir property.

Destination

The name of the folder to copy the file to. Either a relative or absolute pathname, depending on the setting of the UseVirtualDir property.

FailIfExits

If TRUE then an exception will be thrown if the file already exists at the specified destination. If this is FALSE an existing file will be overwritten. Defaults to TRUE.

Remarks

An exception is thrown if the operation fails. Trap for success/failure by examining VBScript's Err object immediately after calling this method (the Number property of the Err object will be a non-zero value if it failed). MAKE SURE that you have enabled inline error trapping by using an On Error Resume Next statement at the beginning of the ASP page.

If UseVirtualDir is set to TRUE then the specified path needs to be relative. It should start with a forward slash and be followed by a valid alias, and any sub-folders need to be separated with forward slashes. If you specify a physical pathname when UseVirtualDir is TRUE an exception will be thrown.

If the default user account does not have the appropriate permission to perform this action then an "Access Denied" error will occur. You can use the ImpersonateUser method to temporarily assume another user account which has the appropriate permission, perform the operation and then call ImpersonationTerminate to resume using the default account.

See Also: FileDelete | FileExists | FileMove