0 votes
by (180 points)
edited

Hi,

When I use Ftp.GetFile() method, it looks like the method first invokes GetFileLength to know the remote file length.

In my case, GetFileLength fails because LIST is not allowed on the server, and I can feed the remote size because I know it. So everytime I donwload, I got a Permission Denied on server size and a wasteful network call.

Is there a way to prevent GetFileLength call when calling GetFile ?

Regards,

Applies to: Rebex FTP/SSL

1 Answer

+1 vote
by (72.7k points)
edited
 
Best answer

I suppose that you mean SIZE instead of LIST command is not allowed on your server.

Anyway, the SIZE command is send automatically only if you registered the TransferProgressChanged event (and TransferType is Binary).

If you want to still be informed about progress you can set the Ftp.Settings.DisableProgressPercentage to true. This will cause that the SIZE command is not sent to the server, progress event is raised, but item length is set to -1 and progress percentage is 0 for whole transfer.

by (180 points)
edited

Thank you for this quick answer !

I mean LIST because I use FileZilla server and the associated right is LIST. But the command is SIZE, you are right. I guess that not giving the right LIST prevent the command SIZE in FileZilla Server.

I'll check the Ftp.Settings.DisableProgressPercentage property in a couple of weeks, not before, and I'll let you know if it resolves my problem.

Regards,

by (180 points)
edited

Hi,

Setting Ftp.Settings.DisableProgressPercentage to true solves my problem.

Thank you again,

Regards,

Christophe

...