FileDelete (Dundas Upload Control 2.0)

Dundas

FileDelete (Dundas Upload Control 2.0)

Overview | Properties | Methods

Call this method to delete a file.

Syntax

UploadObject.FileDelete (Path As String)

The FileDelete method syntax has the following parts:

Part

Description

Path

Location of the file to be deleted. Use either a relative or absolute pathname, depending on the setting of the UseVirtualDir property.

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: FileCopy | FileExists | FileMove