Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.1k views
in .NET FTP by (320 points)
I made a function to download a file or a folder, I was trying to use ftpconnection.getFilesInfos() but i noticed that it some times returns an array with the correct length and some times returnes null, it returns null if the folder name was too long and it wasn't the working directory like saying ftpconnection.getFilesInfos("/folder1/folder2/very loooooooong name");.

To go around it i changed the working directory to this folder
ftpconnection.changeWorkingDirectory("/folder1/folder2/very loooooooong name");
FTPFile[] ff = ftpconnection.getFilesInfos();


now it works fine

Thanks

1 Answer

0 votes
by (51.6k points)
Yes, it's often a good idea to change to the directory first and then get the listing. Thanks for sharing this with other users.

- Hans (EDT)

Categories

...