DirectoryCreate (Dundas Upload Control 2.0)

Dundas

DirectoryCreate (Dundas Upload Control 2.0)

Overview | Properties | Methods

Call this method to create a folder.

Syntax

UploadObject.DirectoryCreate(Path As String, [MustNotExist As Boolean = FALSE])

The DirectoryCreate method syntax has the following parts:

Part

Description

Path

The name of the folder to be created. Either a virtual or physical pathname must be used, depending on the UseVirtualDir property setting.

MustNotExist

A boolean which specifies whether or not the directory must not exist.

  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.

Note that an exception is also thrown if you set the MustNotExist argument to TRUE and the folder already exists. The resulting error string will be "Can not create a file when that file already exists."

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. Any following folders need to be separated with forward slashes.

If the default user account does not have permission to create a folder then an "Access Denied" error will occur. You can use the ImpersonateUser method to temporarily assume another user account which has the permission to create a folder and then call ImpersonationTerminate to resume using the default account.

See Also: DirectoryDelete | DirectoryExists