0

I am trying to connect to an SFTP server with my AIR application. It doesn't matter that it's an AIR application except that I haven't found any libraries or AIR API methods for it.

My first thought is to find a library in another language and rewrite it in ActionScript. I'd rather not do that and my lack of experience may introduce security issues.

My second thought is to call a native process or command such as sftp or sshpass or curl from my main application and pass the local and remote upload locations to it and let it do the work. The downside to this is if they don't have the command installed they have to install a separate program.

My questions are:

  1. Are these SFTP commands available by default on both Mac and Windows?
  2. Should I store the users login (I do not want to) or prompt them to enter it each time? Does SFTP / public key remove the need for that?

I've found two related questions here and here but some of it is over my head. They also seem to be specific to *nux (which may work for Mac as well but not Windows).

I do not have the experience in this area so I would welcome those with experience to give guidance if this is a good idea or not. Overview type answers are welcome for me as I can attempt to work out the details. If no answer is given, once I've figured it out I'll post an answer. Please do not close this question (rather suggest edits).

FYI I'm using AIR to make a native process call.

An AIR application in the extended desktop profile can execute a file, as if it were invoked by the command line. It can communicate with the standard streams of the native process. Standard streams include the standard input stream (stdin), the output stream (stdout), the standard error stream (stderr).

I can also create and call a scpt, sh or bat file.

Commands installed on my Mac:

  • curl_init(), curl_setopt()
  • ssh
  • sftp

Commands not installed on my Mac:

  • sshpass
Community
  • 1
  • 1
1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231

1 Answers1

1

Are these SFTP commands available by default on both Mac and Windows?

No. There is no sftp nor ssh on windows by default, unless you install it through cygwin or bundle them in your application (also solution).

Should I store the users login (I do not want to) or prompt them to enter it each time?

Prompt is preferred.

Does SFTP / public key remove the need for that?

Yes, but you will have to store private key, which is almost the same like storing password.

Jakuje
  • 24,773
  • 12
  • 69
  • 75