Jump to content
Server Maintenance This Week. ×

Upload files to SFTP Server


This topic is 1542 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have exported a PDF that I want to upload to a SFTP  Server, but I cannot get it to work. The SFTP server is located at port 2222.

File: $filepath
FTP Server: ftp.theserver.com
User: ftp_user
Login: password

I was trying with the Insert from URL script step, and specified it as follows:

URL: sftp://ftp.tehserver.com:2222
cURL: --upload-file $filepath --user ftp_user:password

 

I get error "Command is unavailable"

Have I misunderstood the Insert from URL function or am I doing something else wrong?

Thanks,
Andreas

Link to comment
Share on other sites

here some example code for MBS Plugin:

 

Set Variable [$curl; Value:MBS("CURL.New")]

# FTP URL with destination file name:
Set Variable [$result; Value: MBS("CURL.SetOptionURL" ; $curl ; "sftp://12.34.56.78/AZ1677ZZ.jpg")]
Set Variable [$result; Value: MBS("CURL.SetOptionUpload" ; $curl ; 1)]
Set Variable [$result; Value: MBS("CURL.SetOptionPassword" ; $curl ; "xxx" )]
Set Variable [$result; Value: MBS("CURL.SetOptionUsername" ; $curl ; "yyy" )]

# Pick file from desktop:
// Set Variable [$Desktop; Value: MBS("Folders.UserDesktop")]
// Set Variable [$Path; Value: MBS("Path.AddPathComponent"; $desktop; "AZ1677ZZ.jpg")]
// Set Variable [$result; Value: MBS( "CURL.OpenInputFile" ; $curl ;$path )]

# Pick file from container:
Set Variable [$result; Value: MBS( "CURL.SetInputFile" ; $curl ; Test::ImageFileContainer )]

# Upload file
Set Field [Test::PerformResult; MBS( "CURL.Perform" ; $curl )]
Set Field [Test::DebugMessages; MBS( "CURL.GetDebugAsText" ; $curl)]
Set Variable [$result; Value:MBS( "CURL.Cleanup" ; $curl )]

  • Thanks 1
Link to comment
Share on other sites

  • 5 months later...

Christian,

I have a solution that uses the desktop version of MBS to do just that and it works as advertised. The issue is that there is a lot of data--with some included Base-64 images--and there are several dozens of files to send over a mediocre internet connection, so the user's FileMaker is locked up for a few HOURS a day in processing these reports. If I get the server license for MBS, will it work properly to send them to a processing queue and then run them with a Server scheduled script?

The other option that the client is considering is to buy another computer and run it from there, but that would still tie up resources with all the data slinging back and forth.

Suggestions? 

Jonathan

Link to comment
Share on other sites

On 4/19/2019 at 2:49 PM, carlsson said:

URL: sftp://ftp.tehserver.com:2222

 

 

The answer to the original question is that FM expects the format of the protocol part of the URL to be "ftps", not "sftp".... weird but true

Link to comment
Share on other sites

9 minutes ago, Wim Decorte said:

Dunno if it is a bug or not but if you look at the help for the "insert from URL" script step, you'll see a list of supported protocols. and FTPS is there but not SFTP (unless I really missed it).

Yeah, I think that is why I am using MBS. Are you saying that you can access an SFTP server using the FTPS switch in Insert From URL? That would certainly be, as you say, "weird, but true." The protocols are really different. They do transfer files, but the method of encryption and handshaking is really incompatible. I know this because we had to get the client's client to get a whole other FTP Server app just to work with them. FTPS is a bear to work with. I'll stick with Christian's great plugin for the time being.

Link to comment
Share on other sites

  • 3 months later...
On 10/11/2019 at 3:40 PM, Wim Decorte said:

The answer to the original question is that FM expects the format of the protocol part of the URL to be "ftps", not "sftp".... weird but true

Filemaker natively supports ftps but not sftp. These are 2 different protocols. sftp uses SSH for the connection while ftps uses SSL connection.

Edited by fmgenius
Link to comment
Share on other sites

This topic is 1542 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.