0

I have a requirement to enable switching of LocalWorking directory right before file downloads(uploading too) to allow for downloading of files to directories different from the local current working directory. Also, allow uploads from directories order than the current local working directory. Since Xceed FTPClient object does not expose a localdirectory property or procedure that simply allows me specify a subfolder or path to switch to, I tried to use the IssueCommand routine, like so,

ftpClient.IssueCommand(String.Format(" cwd {0}, localworkingpath)); 

What instead happens is the command is executed against the remote machine and not my local.

Assert.IsTrue failed. The file transmission was not successful. Details: Xceed.Ftp.FtpReplyException: C:\MultiDownloads\LocalDirectorySwitch: The filename, directory name, or volume label syntax is incorrect. (reply code 550) at Xceed.Ftp.Engine.FtpCommand.EndExecute(IAsyncResult asyncResult) at Xceed.Ftp.FtpClient.SendCustomCommand(String command)

When I use the command

ftpClient.IssueCommand(String.Format(" lcd {0}, localworkingpath)); 

I obtain the following error message

Assert.IsTrue failed. The file transmission was not successful. Details: Xceed.Ftp.FtpReplyException: 'LCD C:\MultiDownloads\LocalDirectorySwitch': command not understood (reply code 500) at Xceed.Ftp.Engine.FtpCommand.EndExecute(IAsyncResult asyncResult) at Xceed.Ftp.FtpClient.SendCustomCommand(String command)

How do I change the localworking directory of my ftpClient object please? Thanks in advance.

Kobojunkie
  • 6,375
  • 31
  • 109
  • 164

1 Answers1

0

The typical command to change local working directory in a command-line FTP client is lcd.

This isn't my real name
  • 4,869
  • 3
  • 17
  • 30