cURL / Mailing Lists / curl-library / Single Mail

curl-library

AW: libcurl SFTP file upload

From: Mueller, Alexander <am_at_a-m-i.de>
Date: Fri, 4 Apr 2008 13:46:56 +0200

Thanks, Daniel, for the hints.

I will answer the points:

>> Comment this out: curl_easy_setopt(hCurl, CURLOPT_UPLOAD, 1) ;
>> otherwise you'll also get an error after connecting to the server

> Can you elaborate on this? Comment this out from what? Ie can you show
us a full example where this causes problems?

OK, when I leave this line and perform no command, I receive this:

Connected to treuehandy.de (80.67.26.55) port 22 (#0)
SSH authentication methods available:
publickey,password,keyboard-interactive
Using ssh public key file id_dsa.pub
Using ssh private key file id_dsa
Initialized password authentication
Authentication complete
Sending quote commands
Syntax error in SFTP command. Supply parameter(s)!
Connection #0 to host treuehandy.de left intact

After including the line, I get this:

Connected to treuehandy.de (80.67.26.55) port 22 (#0)
SSH authentication methods available:
publickey,password,keyboard-interactive
Using ssh public key file id_dsa.pub
Using ssh private key file id_dsa
Initialized password authentication
Authentication complete
Upload failed: Operation failed
Connection #0 to host treuehandy.de left intact
Closing connection #0

Like I said, without any upload command, just this Option set.

As I said, I cannot input an Upload command, because this leads to the
endless loop:

                headerlist = curl_slist_append(headerlist, "put
C:/test.txt test.txt");

>While you may be tricked into believing that's a fine URL, it isn't.
SFTP and SCP URLs are crafted differently and then no, you probably did
>>not have those directories. An SFTP URL for the local directory
"subfolder" would look like:
>
> "sftp://mydomain.de/~/subfolder/"

Oh, I did not know this, will fiddle around with this new information

>>>
The recognized and working commands are listed in the manual: chgrp,
chmod, chown, ln, mkdir, pwd, rename, rm, rmdir, symlink.
put as in upload is not supposed to be done with a "quote" command, but
with a regular libcurl CURLOPT_UPLOAD approach.
<<<

I did not yet find something about 'quote' commands, do you have a link
for me to clarify ?

Thank you in advance,

Alex
Received on 2008-04-04