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: Sat, 7 Jan 2012 19:48:15 -0500

> Therefore I can only suggest that you make some tests yourself with a
> simple batchfile like this:

> curl -s -k -v -u myusername: --key C:\temp2\keys\id_rsa --pubkey
> C:\temp2\keys\id_rsa.pub -T c:\temp2\test4.txt
> sftp://serveraddress/wrongdir/
> @echo Errorlevel: %ERRORLEVEL%

> to make sure the issue is not with your app code.

Guenter, not sure if the command line parameters you wanted me to add actually works:

1) The first one is to a folder which I have no access permission

C:\Users\mlam>curl -S -k -v -u mlam: --key C:\temp2\keys\id_rsa --pubkey C:\temp2\keys\id_rsa.pub -T c:\temp2\test4.txt sftp://sfcadevftp01/sftp_file_drop --insecure @echo Errorlevel: %ERROR
* About to connect() to sfcadevftp01 port 22 (#0)
* Trying 192.168.19.213... % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
* SSH authentication methods available: publickey,password,keyboard-interactive
* Using ssh public key file C:\temp2\keys\id_rsa.pub
* Using ssh private key file C:\temp2\keys\id_rsa
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Initialized SSH public key authentication
* Authentication complete
* Upload failed: Operation failed (4/-31)
  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
* Connection #0 to host sfcadevftp01 left intact
curl: (79) Upload failed: Operation failed (4/-31)
* Could not resolve host: echo; Host not found
* Closing connection #1
curl: (6) Could not resolve host: echo; Host not found
* Could not resolve host: Errorlevel; Host not found
* Closing connection #1
curl: (6) Could not resolve host: Errorlevel; Host not found
* Could not resolve host: 6; Host not found
* Closing connection #1
curl: (6) Could not resolve host: 6; Host not found
* Closing connection #0

2) This one is to a directory in which I have access permission, and the file was successfully sent

C:\Users\mlam>curl -S -k -v -u mlam: --key C:\temp2\keys\id_rsa --pubkey C:\temp2\keys\id_rsa.pub -T c:\temp2\test4.txt sftp://sfcadevftp01 --insecure @echo Errorlevel: %ERRORLEVEL%
* About to connect() to sfcadevftp01 port 22 (#0)
* Trying 192.168.19.213... % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected
* SSH authentication methods available: publickey,password,keyboard-interactive
* Using ssh public key file C:\temp2\keys\id_rsa.pub
* Using ssh private key file C:\temp2\keys\id_rsa
* Initialized SSH public key authentication
* Authentication complete
  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0} [data not shown]
* We are completely uploaded and fine
100 7 0 0 100 7 0 5 0:00:01 0:00:01 --:--:-- 5
100 7 0 0 100 7 0 5 0:00:01 0:00:01 --:--:-- 5
* Connection #0 to host sfcadevftp01 left intact
* Could not resolve host: echo; Host not found
* Closing connection #1
curl: (6) Could not resolve host: echo; Host not found
* Could not resolve host: Errorlevel; Host not found
* Closing connection #1
curl: (6) Could not resolve host: Errorlevel; Host not found
* Could not resolve host: 6; Host not found
* Closing connection #1
curl: (6) Could not resolve host: 6; Host not found
* Closing connection #0
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-08