DeleteFile Method

Remove a file on the remote host.

Syntax

object.DeleteFile( Filename )

The object placeholder represents an expression that evaluates to a FileTransfer object.

Return Type

Integer

Remarks

The DeleteFile method deletes an existing file from the remote server.

Note that you must have the appropriate permission to delete the file, or an error will occur.

Note that this "remote file management" method of the File Transfer control MAY be supported for some HTTP servers as well as for FTP servers.

The Filename argument specifies the name of the file to delete on the remote host.

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

Example

Private Sub cmdRmFile_Click()
    Dim nError As Long
    
    nError = FileTransfer1.DeleteFile(Trim(txtRemoteFile.Text))
    If nError <> 0 Then
        MsgBox "Delete File error: " & nError
    End If
End Sub

See Also

RenameFile Method


Copyright © 2008 Catalyst Development Corporation. All rights reserved.