Uploading file to SFTP Server

Hi there! The question is for both MacOS & Windows. What’s the current possibilities to save a file via sFTP on a server? Are there any best practices? I have a JSON file which is too large for a GET API which I’d like to put into a specific directory on an sFTP server. Is this somehow possible?

Thank you!

MBS Xojo CURL Plugin can do SFTP upload.
Just try an example with a sftp:// URL.

I use rb-libssh in Lifeboat for SFTP uploads.

1 Like

I handle FTP, FTPS and SFTP with CURLMBS.

1 Like

how do you get the libssh2 part ? as apparently is not found on the Mac and installing it with brew still does not work


1 Like

MBS Xojo CURL Plugin has LibSSH built-in for convenience.
If you do it via declares, you may have to bring your own.

You need to use install_name_tool to rewrite the paths if you’re getting the library from homebrew. This article helped a lot. Otherwise, when you compile it you should set the paths to the Framework folder.

I spent a lot of time figuring this out with the help of N.P. I even ended up writing a GUI tool to help me do so.

found this , but still having trouble on getting it work, I assume that there is no tutorial on how to do that for xojo , on the rb-libssh does not give any details on how to get that and have it setup on MacOS even on deploying it so I guess is confusing.

I had also found that iSSH2 repository, but found it to be less helpful than install_name_tool for my purposes. I believe the author of the rb-libssh2 library works mostly with Windows which may explain the lack of Mac information.

The sample file for SFTP doesn’t work: Error 67 Wrong Password.

Password and Username are correct though.

CURL log message, please?

URL starts with sftp:// ?

Thanks for your help, Christian. It works now!

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.