how to ftp to a different drive

0 votes
asked Sep 9, 2010 by eirelav (220 points)
edited Jul 4, 2012

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
answered Sep 10, 2010 by Jan Sotola (17,310 points)
edited Sep 10, 2010

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
answered Sep 16, 2010 by Brian (180 points)
edited Jul 4, 2012

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.