curl-users
Re: how to FTP upload a whole directory?
From: Bill Mercer <BMercer_at_nccer.org>
Date: Thu, 31 Dec 2009 13:57:33 -0500
Date: Thu, 31 Dec 2009 13:57:33 -0500
Curl itself isn't really meant to do this. You can create a script or
batch file to automate curl for this kind of task.
The overhead from doing multiple connections can be reduced by
combining multiple entries from the directory
into a single invocation of curl, since it will reuse existing
connections in this case.
If you want a single stand-alone program to upload entire folders, you
might want to try wput, which is a
command line utility similar to wget, but for uploading.
-- Cheers, Bill Mercer - National Center for Construction Education and Research bmercer_at_nccer.org 3600 NW 43rd St Bldg G ā—¸ Gainesville, Florida ā—¸ 32606 Phone 352-334-0911 ā—¸ Fax 352-334-0932 http://www.nccer.org >>> On 12/30/2009 at 6:33 PM, in message <65293421.569109f0.4b3be33b.c229_at_o2.pl>, jar123 <jar123_at_o2.pl> wrote: > Hello Kamil, > > thanks for your prompt answer. > I know that I can do it by invoking curl many times, but is there a way to > do it in one shot? > In your solution curl will be reconnecting after transferring each file > which can be a drawback if lots of small files need to be transferred. > > Jarek > > > > Dnia 31 grudnia 2009 0:13 Kamil Dudka <kdudka_at_redhat.com> napisaÅ‚(a): > >> On Wednesday 30 of December 2009 23:51:44 jar123 wrote: >> > How can I upload a whole directory? >> >> I guess you need to invoke curl more times: >> >> for i in *.dll; do >> curl -v -P- -u xxx:xxx ftp://xxx.xxx.xxx.xxx/ -T $i >> done >> >> > When I type this command: >> > curl -v -P- -u xxx:xxx ftp://xxx.xxx.xxx.xxx/ -T *.dll >> > I receive the following output: >> >> The string *.dll is expanded by shell in this case. Only the first file >> is taken as uploaded file and the rest is taken as extra URLs. >> >> Kamil >> > ------------------------------------------------------------------- > List admin: http://cool.haxx.se/list/listinfo/curl-users > FAQ: http://curl.haxx.se/docs/faq.html > Etiquette: http://curl.haxx.se/mail/etiquette.html ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-users FAQ: http://curl.haxx.se/docs/faq.html Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2009-12-31