0 votes
by (220 points)
edited

I can connect to a server using Rebex. client.connect("MK-developmentftp1");

When I do, the default drive I ftp into is D:\ drive. The server also has a "C:\" drive. How do I change directories to the C:\ drive? If I use the following command after logging in : client.ChangeDirectory("C:\")

I get an exception error that says:

C:\ The filename, directory name or volume label syntax is incorrect. (550)

Can anyone tell me what is wrong here?

Applies to: Rebex FTP/SSL

2 Answers

+1 vote
by (18.1k points)
edited

If I understand you well, you are trying to change remote directory (on FTP server) to another drive. I'm afraid that neither FTP protocol nor FTP servers work with "drives". There is a root directory defined on the FTP server and you can change your working directory into its subdirectories, but not to another drive.

I can see several ways to access directories on another drive, but all of them have to be cofigured at the server:

a) If you need to access files on the C: drive only, change your FTP root directory to some directory on the C: drive. Setting of the root directory depends on your FTP server. On most of FTP servers, you can define a specific root directory for each individual FTP user.

b) If you need to access files on both drives C: and D:, you can link desired directory from C: drive to the directory structure under your root FTP directory on the D: drive. You can do it either by defining virtual directory on your FTP server (if the server supports it - most do) or by defining link on your filesystem. For example, to link directory C:\data\public to D:\ftproot, you can use following MS Windows command on Windows Vista, Windows 7, or Windows Server 2008:

   mklink /d D:\ftproot\public C:\data\public    
+1 vote
by (180 points)
edited

If you don't mind using SFTP to do your transfers, you can use the Bitvise SFTP service. The service create virtual mappings for all your physical drives and you can add network drives that are mapped when a user logs in.

...