Transfer of binary file to another server through SFTP

Hello Everyone,

I want to transfer a CSV/Excel file from my application to another server with the help of SFTP.

Right now the server that I'm using is the my localhost and it is perfectly getting connected with the credentials.

I have tried SFTP extension(method) like put to pass the binary file to my local server but I'm unsuccessful in transferring the files. 

Can anyone please explain how to properly use the SFTP extension in my action element.

Any example or oml file will be really helpful? 

Hi,


What is the problem exactly?

What errors do you get?

Where are your files located?

They have to be on the server before you can move them to another server.


Hey J,

The problem is that In my action I'm using a put method from SFTP plugin to send a CSV/Excel file to the local server. By doing this I should be able to store that file in my local servers repository. (In this case, it is my local repository, it can be some external server also).

But instead, 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 172.30.90.31:22".    It is also there in the 2 screenshots given.

About the files,  I'm generating the excel files from my application and sending it in the put method properties along with all other credentials. You can see it in the screenshot given (properties tab).

Apparently, the files are there in my application only.

So, basically, I need to send a file to another server through SFTP. 

Can you help me to archive that?



Hi Beeta Sahoo,

Also add path where you want to save the file and along with file name

Regards,

Koushik

Hi 

This error means OutSystems Server  can not connect to your SFTP Server.


According to your screen capture

- You are using PE (Personal Environment) that is on Cloud.

- IP of your SFTP Server is Private Network that are not same with PE.

That's why you got error.


I'm not sure where is your SFTP Server. You'd better check with Admin of your SFTP server 

- Whether your SFTP Server can be accessed from Cloud?

- If can, what is the IP address ? (Usually it is Global IP or Public Host)


Regards

Wei

Hey Wei,

That is something I didn't recognize at all,

I didn't know that our Personal environment has to be the same as the SFTP environment.

BTW, I'm using an SFTP server which I have created myself in my localhost environment. Maybe that's the reason I'm not able to connect.

 This was just a try to connect from my local environment to SFTP. But in my actual project, I have the same environment for both outsystems and SFTP and it will take some time (few more days) to download and install the SFTP module in my actual project environment (due to some company policy where I'm working).

For now, can you give some solution of how to use the SFTP module in outsystems, since I couldn't find any official document of How to use SFTP in outsystem. I genarally mean to say "Is put method enough to transfer the file from out outsystems server to SFTP server " or is their anything else to do ?

Hey Beeta


> Is put method enough to transfer the file from out outsystems server to SFTP server.

  Yes, put action is enough to transfer file. as soon as your outsystems can communicate with your sftp server.

  You can download demo application, and it will show you how to upload file.


Regards

Wei