Hello Everyone,

How can I use SFTP module to transfer a binary file to another server?

Say, for example, by clicking of a button I want to transfer a binary file through SFTP.

Any Suggestions?

Hi Beeta,

I'm not sure where your problem lies. The SFTP forge component has a number of actions that you can use, amongst which, iirc, a Put Action that transfers a file to an SFTP server.

Kilian Hekhuis wrote:

Hi Beeta,

I'm not sure where your problem lies. The SFTP forge component has a number of actions that you can use, amongst which, iirc, a Put Action that transfers a file to an SFTP server.

Hey Kilian,

Yes, I'm trying to transfer a file PUT action and I'm giving all the required credential along with the Binary file.

But I'm getting an error as :

 " A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 'myserver_name':22 "

Do I need to do something else for the connectivity through my SFTP server in my action or somewhere else?

I'm not getting any solution.

Hi Beeta,

You can only send files via SFTP if the destination computer has an SFTP server set up and is listening on the right TCP port. You cannot transfer files to just any computer.

Yes, Kilian

The destination has SFTP server set up and I'm listening to that port/TCP/IP only, not to any computer.

Solution

In that case, make sure that the address and the port are correct. Did you try to connect with a normal SFTP program (like FileZilla) if the connection is open? And can the SFTP server be reached from your OutSystems server? Where is the OutSystems server located? In the cloud? If so, does the SFTP server allow connections from there?

Anyway, this is very likely an infrastructure problem, not something of the OutSystems Platform or the SFTP component.

Solution

Kilian Hekhuis wrote:

In that case, make sure that the address and the port are correct. Did you try to connect with a normal SFTP program (like FileZilla) if the connection is open? And can the SFTP server be reached from your OutSystems server? Where is the OutSystems server located? In the cloud? If so, does the SFTP server allow connections from there?

Anyway, this is very likely an infrastructure problem, not something of the OutSystems Platform or the SFTP component.

Hi Kilian,

Not FileZilla, but I have used WinSCP application and I'm able to connect with that to the server with the same credentials that I have given in the put action in my outsystems application.

Yes ,My server is located in cloud only.

Yes, the SFTP allows the connection from there, that's how I'm able to connect through WinSCP.

but what do you mean by infrastructure problem? I didn't get.

Hi Beeta,

If you use WinSCP from your local machine, and the server you are connecting to is also on your local network, it's not surprising it works. That doesn't say anything about whether the connection from the cloud is allowed to the SFTP server. This is not related to OutSystems at all, but related to the configuration of whatever firewall the SFTP server uses.