Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
13.5k views
in Java FTP by (280 points)
Say I'm trying to download a filename with a space, for example: FILEWITH SPACE.TXT
using java:
String[] fileinfo=ftp.dir("FILEWITH SPACE.TXT",true);
I'm pulling from different servers and it seems to work ok on a Unix type remote machine, but on a WindowsNT, I get an error like the following:

com.enterprisedt.net.ftp.FTPException: FILEWITH: The system cannot find the file specified

:(

8 Answers

0 votes
by (161k points)
You may need to try

dir("FILEWITH*")

Say I'm trying to download a filename with a space, for example: FILEWITH SPACE.TXT
using java:
String[] fileinfo=ftp.dir("FILEWITH SPACE.TXT",true);
I'm pulling from different servers and it seems to work ok on a Unix type remote machine, but on a WindowsNT, I get an error like the following:

com.enterprisedt.net.ftp.FTPException: FILEWITH: The system cannot find the file specified

:(
0 votes
by (280 points)
That's not a really good solution for my app.
Looks like I may be running an older version,
I have a folder named "ftp-1.2.3" Is this something that may be fixed in a newer version?
How do I know what version I have?
I guess I will download the newest and give that a shot...
0 votes
by (161k points)
Definitely get the latest version. 1.2.3 is very old, we are up to 1.4.5 currently.

That's not a really good solution for my app.
Looks like I may be running an older version,
I have a folder named "ftp-1.2.3" Is this something that may be fixed in a newer version?
How do I know what version I have?
I guess I will download the newest and give that a shot...
0 votes
by (280 points)
upgrade did not fix the problem
0 votes
by (161k points)
Does get(xyz, "FILEWITH SPACE.TXT") work for you?

dir() methods are really for listing directories rather than files

upgrade did not fix the problem
0 votes
by (280 points)
It seems as tho there actually needs to be a backslash escape character for getting files from an NT server.

My directory filename also has a space! (I am trying to have these issues fixed with the remote host)

dir("DIR*") seems to work, but
dir("DIR*", true) will not, and neither will
dir("DIR\ NAME", true)

So I can't see any of the directory file details...
0 votes
by (280 points)
Well thank goodness it was only the test data I was trying to retreive off an NT server... my live info in on Linux. Whew!
0 votes
by (161k points)
We'll see if we can find a way around this problem anyway ...

Well thank goodness it was only the test data I was trying to retreive off an NT server... my live info in on Linux. Whew!

Categories

...