11-11-2011
Using CURL for FTP
Hello,
I am using curl command to interact with the FTP server. I have gathered some information around downloading / uploading of files using curl command.
However, I couldn't find any information around
1) Listing all the files on FTP server in any given folder having a specific extn.
( ls *.config )
2) Moving files across different folders on FTP server
In short, I am looking out for information which details about using FTP commands on FTP server using curl command.
It will be really helpful. Thanks in advance !!
- Amit
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Aren't there any way to download files as below?
For example, I want to download all .html files under the root directory of unix.com/
curl -O https://www.unix.com/*.html
This won't work, but please tell me the way to do this.
Well, the best way is to get the file list of the directory, but i... (6 Replies)
Discussion started by: Euler04
6 Replies
2. Shell Programming and Scripting
I have to transfer a file from my aix box to another server using ftps protocol, how can i achieve this using curl preferably or any other utility.
Regards
Sandeep (0 Replies)
Discussion started by: jayawantsandeep
0 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I know this is probably a very silly question for most but how to do I force curl to do active FTP downloads?
Thank you
Dallas (2 Replies)
Discussion started by: Dallasbr
2 Replies
4. Shell Programming and Scripting
Currently I am trying to download a file from a secure site that I do not control. I need to use a pem cert to get past their firewall. Currently I am trying to use curl to get the file and return it using the following information pemcert.txt containing the cert, username, password, domain,... (0 Replies)
Discussion started by: gandolf989
0 Replies
5. Shell Programming and Scripting
Hi
I am trying to fetch a file from a remote location and download it into a local directory ...i was previously doing it quite simply using ftp but now i need to do the same using the cURL tool ...Here i am not getting an option to specify a directory name i am trying the following but... (0 Replies)
Discussion started by: jamshedj
0 Replies
6. Shell Programming and Scripting
Hello - I'm a novice, so apologies if this is a stupid/answered question.
I'm operating on a mac, and I'm using ftp to transfer files to my computer. The files have atypical names, although I have a list of them, addresses included. Is there a way to automate this using curl?
That is to... (3 Replies)
Discussion started by: Qroid
3 Replies
7. Shell Programming and Scripting
Hi all;
first of all i need to clarify that i am new to apache2 server configuration and for some needs i want to transfer some files using curl to web directory,so please bear with me:
following is the command i m running to transfer file to my web directory:
curl -T "q"... (4 Replies)
Discussion started by: arien001
4 Replies
8. Shell Programming and Scripting
hello,
I'm trying to upload a file to this ftp server and others ftp://ftp.byethost12.com as you can see in the output of CURL using the -v option
curl reports that the upload succeeded but when i connected to the server with file-zilla there is no file uploaded the same command
upload files... (5 Replies)
Discussion started by: laraaj
5 Replies
9. Shell Programming and Scripting
Hello all,
I have been struggling with this issue on and off for a couple of weeks now and I just got it all working, so I wanted to share my findings in case some other poor soul needs to know how. First some background on what I'm doing. I am uploading files to different directories based on... (0 Replies)
Discussion started by: msjkadams
0 Replies
10. UNIX for Dummies Questions & Answers
Hi,
For an order I requested, the provider has uploaded a tar file in public FTP site which internally has tons of files (compressed) and I need to download files that follows particular pattern which would be few hundreds.
Note: The order can't be requested for files that follows the... (7 Replies)
Discussion started by: Amalan
7 Replies
LEARN ABOUT MOJAVE
curlopt_dirlistonly
CURLOPT_DIRLISTONLY(3) curl_easy_setopt options CURLOPT_DIRLISTONLY(3)
NAME
CURLOPT_DIRLISTONLY - ask for names only in a directory listing
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DIRLISTONLY, long listonly);
DESCRIPTION
For FTP and SFTP based URLs a parameter set to 1 tells the library to list the names of files in a directory, rather than performing a full
directory listing that would normally include file sizes, dates etc.
For POP3 a parameter of 1 tells the library to list the email message or messages on the POP3 server. This can be used to change the
default behaviour of libcurl, when combined with a URL that contains a message ID, to perform a "scan listing" which can then be used to
determine the size of an email.
Note: For FTP this causes a NLST command to be sent to the FTP server. Beware that some FTP servers list only files in their response to
NLST; they might not include subdirectories and symbolic links.
Setting this option to 1 also implies a directory listing even if the URL doesn't end with a slash, which otherwise is necessary.
Do NOT use this option if you also use CURLOPT_WILDCARDMATCH(3) as it will effectively break that feature then.
DEFAULT
0, disabled
PROTOCOLS
FTP, SFTP and POP3
EXAMPLE
TODO
AVAILABILITY
This option was known as CURLOPT_FTPLISTONLY up to 7.16.4. POP3 is supported since 7.21.5.
RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
SEE ALSO
CURLOPT_CUSTOMREQUEST(3),
libcurl 7.54.0 February 03, 2016 CURLOPT_DIRLISTONLY(3)