Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.7k views
in Java FTP by (280 points)
When tried to FTP a windows machine, the following statement threw exception

FTPFile[] list = ftp.dirDetails(currentDir);
Error occurs when the currentDir parameter has spaces in between
for example if currentDir is 'Documents and Settings' i got the following exception
But the above scenario works fine when i FTP a Linux machine.

----------------------
[ edtftp version 1.4.5 ]

com.enterprisedt.net.ftp.FTPException: /Documents: The system cannot find the file specified.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:668)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:1902)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1816)
at FTPUtil.doFTP(FTPUtil.java:72)
at FTPUtil.main(FTPUtil.java:119)

----------------------
[ edtftp version 1.4.2 ]

com.enterprisedt.net.ftp.FTPException: /Documents: The system cannot find the file specified.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:613)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:1684)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:1598)
at FTPUtil.doFTP(FTPUtil.java:72)
at FTPUtil.main(FTPUtil.java:119)

---------------
Any help higly appreciated

regards,
vinothk

4 Answers

0 votes
by (162k points)
dirDetails does work with spaces in directory names - I've just tested it. However this may be dependent on the FTP server you are communicating with. Is it IIS?

When tried to FTP a windows machine, the following statement threw exception

FTPFile[] list = ftp.dirDetails(currentDir);
Error occurs when the currentDir parameter has spaces in between
for example if currentDir is 'Documents and Settings' i got the following exception
But the above scenario works fine when i FTP a Linux machine.

0 votes
by (280 points)
Yes it is IIS server. is it not possible in IIS server ?
and the OS is Windows 2000 professional edition

regards,
vinothk
0 votes
by (162k points)
We'll run some tests against IIS to see if there is a problem.

Yes it is IIS server. is it not possible in IIS server ?
and the OS is Windows 2000 professional edition

regards,
vinothk
0 votes
by (280 points)
Hi,
I tried out something and everything works fine for me now.

i gave
ftp.chdir('Documents and settings');
FTPFile[] files = ftp.dirdetails(null);
Now this gives the details of all the files and folders under 'Documents and settings'. Though this solves my problem, i think
FTPFile[] files = ftp.dirdetails(ftp.pwd());
really has some problems.

thanks for the support

regards,
vinothk

Categories

...