cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using ftpupload.c returns a directory listing in HTML format

From: Nils Söderman <nils_at_meditalk.com>
Date: Tue, 11 Aug 2015 18:46:12 +0200
Thanks!
>Because you didn't specify which protocol to use so libcurl guesses you meant HTTP and so it asked the server using >HTTP on port 80 and it returned data using HTML...
So that explains the HTML-coding!
Can the reason for the  error code for address "ftp://192.168.0.151/backup/ftptest/" be that I am working within my LAN? I am using a RaspberryPi to send messages to my archive, a Netgear NAS on my LAN. From command prompt on my Win7 PC I can start FTP on the archive with >ftp 192.168.0.151 whereas the ftp server asks for username etc. A "cd backup" displays a "backup>" prompt. A "dir" now lists my directory (without HTML coding, HI!)
So my question: how to write REMOTE_URL string when working inside a LAN?
I am at loss...
Nils

    
Den 2015-08-11 kl. 17:20, skrev Daniel Stenberg:
On Tue, 11 Aug 2015, Nils S wrote:

I am using the example ftpupload.c changing
REMOTE_URL   to   "192.168.0.151/backup/ftptest/" whereas I get the directory listing of backup directory in HTML coding as return.

Because you didn't specify which protocol to use so libcurl guesses you meant HTTP and so it asked the server using HTTP on port 80 and it returned data using HTML...

When I try with
#define REMOTE_URL      "ftp://192.168.0.151/backup/ftptest/"

I get error: curl_easy_perform() failed: URL using bad/illegal format or missing URL.

That's strange. It looks like a perfectly fine URL to me.

I can use command line access to the NAS...

You mean command line curl? Then you can just add "--libcurl ftplist.c" to generate C code for your libcurl using application...


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-11