cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: The FTP problem that turns out to be SFTP

From: Michael Lam <Michael.Lam_at_silkroad.com>
Date: Thu, 5 Jan 2012 15:08:03 -0500

>Your screenshot shows that your issue isn't about FTP at all. Is it SFTP? Then
we need to know more details that isn't shown there.

Yes this is an SFTP problem.

>Can you please provide a short stand-alone source code example that repeats
the bug? What libssh2 version are you using? I assume this is running on
windows?

The libssh2 version is 1.2.5 IDN-Windows-native libssh2. We are using c# to call the cURL exe by starting a process and pass in arguments in the same manner as a command line prompt:

     fileName = "c:\temp\MyFile.txt"; // name of file to be transferred
     string argument = string.Empty;
           argument =
       string.Format(
        @"-v -u {0}: --key ""{1}"" --pubkey ""{2}"" -T ""{3}"" ""{4}"" --insecure",
        ftpsAdapterConfiguration.User, ftpsAdapterConfiguration.AuthenticationKeyPath, ftpsAdapterConfiguration.EncryptionKeyPath, fileName,
        ftpsAdapterConfiguration.Url);

     ProcessStartInfo startInfo = new ProcessStartInfo
     {
      Arguments = argument,
      RedirectStandardError = true,
      UseShellExecute = false,
      FileName = exePath // curl.exe's path
     };
     Process myProcess = new Process { StartInfo = startInfo };

      myProcess.Start(); // run cURL exe
      // Synchronous processing
      myProcess.WaitForExit();
      int exitCode = myProcess.ExitCode;
      // Checks for error code

       string output = myProcess.StandardError.ReadToEnd();
       output = string.Format("Ftp process failed for File '{0}'. ErrorDetails='{1}'. Retry: '{2}'", fileName,
               output, retry);
     
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-05