views:

448

answers:

1

Hi, I am new to the libcurl and found a way to download a single file from the ftp server. Now my requirement is to download all files in a directory and i guess it was not supported by libcurl. Kindly suggest on libcurl how to download all files in directory or is there any other library similar to libcurl?

Thanks in advance.

A: 

You need the list of files on the FTP server. Which isn't straightforward as each FTP server might return a different format of file listing...

Anyway, the ftpgetresp.c example shows a way to do it, I think. FTP Custom CUSTOMREQUEST suggests another way.

PhiLho
Hi, Thanks a lot. I was able to retrieve files in a directory using the FTP Custome CUSTOMREQUEST. I got another question, with the multiple files is it recommended to use curl_multi or transferring one file at time?
Thi
I found another way to retrieve just the files in a directory using CURLOPT_DIRLISTONLY option. I tried using the CUSTOMREQUEST command i need to do lot of parsing but with the CURLOPT_DIRLISTONLY option we can just get the filenames not other information.
Thi