EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTP from in-browser Silverlight app fails

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 02/15/2012 16:54:25
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10


I'm encountering an error when I try to FTP with an in-browser Silverlight app. The EEIFTPSError exception has the message 'Control channel transfer error'. This only happens when running in-browser. This is straight FTP (not FTPS).

I have set the FTP server to listen on port 4503 and also have set PASV ports to 4505 - 4534, to accommodate the Silverlight limitations. I've also put proper clientaccesspolicy.xml file, and SFTP is working in-browser. Out of browser seems to work fine.

The code below should be able to reproduce the issue:

            TElSimpleFTPSClient client = new TElSimpleFTPSClient();
            client.Socket.ClientAccessPolicyProtocol = SBSocket.TElSocketClientAccessPolicyProtocol.cappHttp;
            client.UseSSL = false;
            client.Port = 4503;
            client.Address = "IPAddressHere";
            client.Username = "username";
            client.Password = "password";
            client.AdjustPasvAddress = true;


            client.OnProgress += new SBUtils.TSBProgressEvent(client_OnProgress);
            using (FileStream fs = fileInfo.OpenRead())  // I have fileInfo passed
                client.Send(fs, fileInfo.Name);


Would appreciate some guidance to go forward with this please.

Muljadi Budiman.
Posted: 02/15/2012 17:05:06
by Ken Ivanov (EldoS Corp.)

FTP uses a secondary socket connection for data transfers. Therefore, the ClientAccessPolicyProtocol should be also configured for that secondary socket:

client.DataSocket.ClientAccessPolicyProtocol = SBSocket.TElSocketClientAccessPolicyProtocol.cappHttp;
Posted: 02/16/2012 08:51:10
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10

Hi Innokentiy.

client.DataSocket seems to always be null - I'm even looking at handling OnControlReceive / OnControlSend event and can't see it being populated. That property is also read-only so I can't just create my own SBSocket.

Any other suggestions? I would almost expect if the DataSocket is created within the class, it should follow the settings of the client.InternalSocket, so the ClientAccessPolicyProtocol should be copied as well.

Muljadi Budiman.
Posted: 02/16/2012 09:01:30
by Ken Ivanov (EldoS Corp.)

Hi Muljadi,

You appear to be right. The data socket object is created right before the data connection is initiated, so you won't be able to access it on an earlier stage. We will update the component to copy the policy protocol setting from the control channel socket, this will eliminate the issue.

Thank you for pointing us at this.
Posted: 02/16/2012 09:06:59
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10

Thank you Innokentiy.

If you guys need someone to test / verify the update, I'd be willing to give it a spin.

Muljadi Budiman.
Posted: 02/16/2012 10:13:22
by Ken Ivanov (EldoS Corp.)

Thank you for that. We've just updated the FTPS component according to the above discussion. Just in case if you have a spare moment and a will to check if it resolves the issue for you, I'll upload the updated assembly to your Helpdesk ticket.
Posted: 02/16/2012 10:34:14
by mbudiman (Basic support level)
Joined: 02/14/2012
Posts: 10


Definitely appreciate the fast turnaround; verified the new assembly works - now both in-browser and non-elevated OOB Silverlight app have the FTP works wonderfully.

Thank you Innokentiy - I'll look forward to the Monday refresh.

Muljadi Budiman.
Posted: 02/16/2012 10:59:06
by Ken Ivanov (EldoS Corp.)

Wonderful, thank you very much for checking that!
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.



Topic viewed 1589 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!