I am attempting to download all files in the root folder of an ftp server that uses a virtual directory, but the xceed ftp component is not recognizing the command. Is there some way I can get around this error?
heres my code
Public Function DownloadFiles(ByVal strFileMask As String, _
ByVal strLocalFolder As String) As Integer
If Not Initialized Then Initialize()
Dim intVal As Integer = 0
Dim localFolder As Xceed.FileSystem.DiskFolder
Dim remoteFolder As Xceed.Ftp.FtpFolder
Try
If con Is Nothing Then
con = New Xceed.Ftp.FtpConnection(m_strServer, m_intPort, m_strUser, m_strPass)
con.DefaultRepresentationType = m_rtTransferType
End If
localFolder = New Xceed.FileSystem.DiskFolder(strLocalFolder)
remoteFolder = New Xceed.Ftp.FtpFolder(con) ' error occurs here
remoteFolder.CopyFilesTo(localFolder, False, True, New NameFilter(strFileMask))
intVal = 1
Catch ex As Exception
Debug.WriteLine(ex.ToString())
intVal = -1
End Try
Return intVal
End Function
'Exception Thrown
"Xceed.FileSystem.FileSystemException: An error occurred while getting the starting folder.
Type: Xceed.Ftp.FtpFolder
FullName: ---> Xceed.Ftp.FtpReplyException: Invalid reply format to PWD command.
at Xceed.Ftp.Engine.FtpCommand.EndExecute(IAsyncResult asyncResult)
at Xceed.Ftp.Engine.FtpCommand.Execute(FtpCommandChannel commandChannel)
at Xceed.Ftp.FtpClient.GetCurrentFolder(FtpCommandChannel commandChannel, CurrentFolderFtpCommand command)
at Xceed.Ftp.FtpClient.GetCurrentFolder()
at Xceed.Ftp.FtpFolder.GetStartingFolder()
The FTP reply was:
230 <virtual directory>
--- End of inner exception stack trace ---
at Xceed.Ftp.FtpFolder.GetStartingFolder()
at Xceed.Ftp.FtpFolder..ctor(FtpConnection connection)
at MedXPress.Service.FTP.DownloadFiles(String strFileMask, String strLocalFolder, String[]& strFileList, String& strResponse) in C:\Documents and Settings\user\My Documents\Visual Studio 2005\Projects\ftpService\FTPClient.vb:line 115"