Solved

connecting to a sftp server

  • 20 June 2016
  • 3 replies
  • 182 views

Badge

I am trying to use either the FTP caller or the HTTP caller to post/send a file to a sftp site. I have tried multiple settings and no luck. In FileZilla I can go into site manager and choose SFTP-SSH file transfer protocol and put in all information and it works. It calls the address https:// instead of sftp:// but works and connects. My goal is to automate this so I do not have to manually connect and upload the files to the SFTP site. Any help on the settings I need to use would be greatfull:

In FTP caller I have used set the URL to sftp and ftp. it stays red when I try to use https. Is their somewhere that i can declare it a sftp so it will be https?

In httpcaller it will accept https but fails out. I use http authentication but will not connect still. I am not sure what else i need to do to get it to connect.

My goal is to have FME send the files to this sftp so I do not have to manually do it.

icon

Best answer by roland.martin 21 June 2016, 20:18

View original

3 replies

Badge +9

Hi @kouri1986,

SFTP support was added for the FTPCaller in FME 2016.0. Do check and see if perhaps you are on a slightly older release. Could you tell us more about the use of https:// instead of sftp://? Do you have any information as to why you need to access the service using https?

Another idea here is using a shutdown script to call a program to upload the data. You can see a sample of this type of workflow using WinSCP here: https://knowledge.safe.com/articles/788/transfer-w...

Regards,

Brian Pont

 

Badge

Hi @kouri1986,

SFTP support was added for the FTPCaller in FME 2016.0. Do check and see if perhaps you are on a slightly older release. Could you tell us more about the use of https:// instead of sftp://? Do you have any information as to why you need to access the service using https?

Another idea here is using a shutdown script to call a program to upload the data. You can see a sample of this type of workflow using WinSCP here: https://knowledge.safe.com/articles/788/transfer-w...

Regards,

Brian Pont

 

I am not sure, when I use FILEZILLA to connect to the SFPT it puts the URL as HTTPS://. so not sure why. I am currently using FME 2016.1.01 64bit edition.

Badge +7

This may not be directly relevant, but I had some problems with SFTP a couple of months ago, and Safe looked into this for me (C113386). The problem I was having was caused by FME refusing to connect via our company proxy, and so failing to open a connection.

As a workaround, I installed WinSCP. You can call it from FME using its scripting. Use an AttributeCreator to build an attribute containing something like the following:

open {FTP_CONNECTION_NAME}
cd "{REMOTE_DIRECTORY}"
lcd "{LOCAL_DIRECTORY}"
get "{FILE_NAME}"
exit

... replacing the curly brackets as appropriate.

Then use an AttributeFileWriter to write that as a file onto your C drive.

Then use a Decelerator with a couple of seconds of delay to prevent the next call from running before the file has finished writing.

Finally, use a SystemCaller, with a command such as:

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="C:\script.txt"

Hope this helps!

Reply