I've been using my code for a long time and it's been working just fine. Now, I encountered server with a problem. It's a first server that required ACTIVE mode. Fine, I set client to active mode and all is well on writing files to server. However, I can't read files. Here is commands I run:

Code

// Connect to FTP and open in folder:
var client = this.GetFtpClient(connection);
client.Cwd(connection.FtpOutgoingFolder);

// Get files one by one
foreach (var teiFileInfo in fileList.OfType<TElFTPFileInfo>().Where(teiFileInfo => teiFileInfo.FileType == 2))

Connect, set folder (Cwd) and get list of files. If I connect with FileZilla, there is files in there. But GetFileList does not return anything. And there is no exceptions. Basically it behaves like there is nothing in folder.

I’ve noticed there is no license ticket linked to your user account on EldoS site. Support is provided to customers with the linked license tickets. You will find your license ticket together with all the details about how to use it in the registration e-mail that we’ve sent to you upon the purchase.

If you are evaluating the product and don't have a license yet, please let us know and then you can have support according to Basic support level. Basic support level includes answering basic technical questions that appear during product evaluation period.

I did try sample project and it did work. But it doesn't work.. Let me explain... See full log. Connect to server, cwd to folder and list files. If you see - there is 2 LIST commands. First one lists files and second one doesn't. Code below..

This is slightly modified sample code. First line is simple List command from your sample, list obtained via callback function _OnTextDataLine. But in our software I use return parameter, this is second command I added and it works for all we did until now.

Do I understand it right, that GetFileList method fails while LIST command works?

It looks like the parser doesn't understand the format used by the server and so it can't provide a listing.

The roots of the problem lie in the FTP standard, which does not specify how the directory listing must be provided. Consequently each server uses its own format. There exist over 400 (maybe even more) formats used by different servers.

SecureBlackbox implements the parsers for Unix and Windows formats, two the most popular ones.

There was an extension to the standard defined some time ago, shortly named MLST. This is a command (two commands, MLST and MLSD) which produce the listing in machine-readable format. Not all servers support it though. Yours doesn't (support for MLST is advertised in the response to FEAT command).

When MLSD is supported, SecureBlackbox tries to use it. In your situation, unfortunately the only option is to write your own parser.

This task is not very complicated -- you can use TElStringTokenizer class to split each string into tokens, then take the last token. The only complication can be if file names have spaces in them. In this case your parser would need to find the token that "looks like time" (eg. 13:15) and then use the rest of tokens and concatenate them back to make a file name.

GetFileList(params, out list) does not work. Returned list is empty and _OnTextDataLine event not fired. It doesn't fail, there is no exceptions thrown. It returns empty list.

I'm puzzled as I don't know how to approach it, it's a part of a system, we don't write cleint for each FTP server. So, if X number of connections work just fine, what should I change and how to make this new connection work?

I Understand if I got List back but TElFtpFileInfo objects didn't have fields populated or I got list of not parsed strings - then I can deal with it. But now structure of the code have to be changed.

GetFileList(params, out list) does not work. Returned list is empty and _OnTextDataLine event not fired. It doesn't fail, there is no exceptions thrown. It returns empty list.

This corresponds to what I have described in the previous message. GetFileList() lets response strings pass to the event handler. The overload which accepts TElList (ArrayList) as a second parameter grabs the list of strings (so they don't go to the event handler) and attempts to parse those strings. Parsing fails due to what I have described above.

Quote

Ivan Demkovitch wrote:
I Understand if I got List back but TElFtpFileInfo objects didn't have fields populated or I got list of not parsed strings - then I can deal with it. But now structure of the code have to be changed.

... or we need to change the implementation of GetFileList, breaking the existing logic. You have suggested a good idea to create a list of TElFtpFileInfo objects and return the unparsed strings in those objects somehow.

This is something we can do in the next version (verison 14, which we preliminary plan for October). We can't do this now, because this can have unexpected effects on other users' code.

As you are using version 11, I don't have any solution for you other than making additions to your code (which needs to be amended to parse the strings anyway).

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.