GetFileName (Dundas Upload Control 2.0)

Dundas

GetFileName (Dundas Upload Control 2.0)

Overview | Properties | Methods

Call this method to extract the filename from a fully specified path.

Syntax

UploadObject.GetFileName(Path As String) As String

The GetFileName method syntax has the following part(s):

Part

Description

Path

Full path and filename with extension

Remarks

This method simply truncates the filename (with the extension) from a full pathname. Note that this method does not check for the existence of the directory nor the file.

This method is very useful if you are looping through the Files collection and want to copy or move files saved to disk to another location, possibly depending on some sort of criteria concerning the uploaded file. Use GetFileName with the UploadedFile object's Path property as the Path argument so that you can copy the file(s) to another location using the same filename. See the Copy method for sample source code illustrating this.

An exception IS NOT RAISED if the specified file in the pathname does not exist.

See Also: GetFileDirName | GetFileExt