how to change directory on ftp server using commons net

Hi,

M logging on ftp server. And can list all file on home directory.

But my application requires that i need to save files on other directory.

To elaborate the problem:

My HOME Directory is : E:\EIS

i can upload files on the above location.

but i m not able to upload files on D:\EIS.

method changeDirectory is not working

220 Service ready for new user

220 Service ready for new user

USER nick

331 User name okay, need password for nick

PASS 1234

230 User logged in, proceed

USER sutapa

331 User name okay, need password for sutapa

PASS 12345

230 User logged in, proceed

CDUP

200 Directory changed to /

CWD D:\EIS

431 No such directory

SYST

215 UNIX Type: FtpServer

PORT 10,42,71,36,12,17

200 Command PORT okay

LIST

150 File status okay; about to open data connection

226 Closing data connection

it says D:\EIS does not exists ....but the directory is already there with all read write permission..

I cant figure out the logic of how to change the directorty on ftp server.

Any help is welcome...

[1193 byte] By [nick_kd07a] at [2007-11-26 14:27:41]
# 1

I assume that

CWD D:\EIS

is trying to change to directory D:\EIS on the machine that the server is hosted on. As a security feature, most FTP servers do not allow one to change to an arbitrary directory but restrict one to directories in a tree rooted on a user specific directory. The root of this tree is denoted as / and all directories are relative to this.

You can check this by using a standart ftp client to see just what your server will allow you to do.

Message was edited by:

sabre150

sabre150a at 2007-7-8 2:21:17 > top of Java-index,Archived Forums,Socket Programming...
# 2
Thanks buddy for ur suggestion....i solved that problem...its not possible to change directory.....i.e from E: to D:.u can change to any directory in root directory....
nick_kd07a at 2007-7-8 2:21:17 > top of Java-index,Archived Forums,Socket Programming...