cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: sftp upload - curl error 79 Error in the ssh layer

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Thu, 20 Mar 2014 14:05:17 +0100

"Petr Ent" <petr.ent_at_gmail.com> wrote:

>I assumed that since command line curl accepted target path without
> the filename, library would behave the same. Clearly I was wrong :).
> Anyway, I think something like "In upload mode, CURLOPT_URL must
> contain full path including filename" would help a lot.

A "full target path".

I just tried a curl SFTP upload to my site, but failed (it worked
fine in FileZilla btw). It was not before building libcurl with
'CURL_LIBSSH2_DEBUG', I discovered the full target path had to be:
  /customers/c/3/1/**.net/httpd.www/

I.e.:
  curl -k -T <local-file> sftp://sftp.**.net/customers/c/3/1/**/httpd.www/

A real PITA that the initial dir in SFTP is not the same as in FTP.

Btw. It would be nice if 'libssh2_trace()' could be coupled to
  'CURLOPT_VERBOSE' somehow. Since the bit-mask '~0' now produces
  2 MByte of trace for a 8 kByte upload!

Btw2. Here's the trace that was most helpful to solve the problem:
  [libssh2] 5.531250 Failure Event: -31 - Failed opening remote file
  [libssh2] 5.531250 SFTP: got FXP_STATUS 4

--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-20