cURL / Mailing Lists / curl-users / Single Mail


Re: wildcards for uploads

From: Seb <>
Date: Thu, 11 Oct 2007 18:37:24 -0500

On Thu, 11 Oct 2007 16:08:14 -0700,
Brian Dessent <> wrote:


> I wonder if this has to do with URL requiring a trailing slash on the
> end.

No, I was aware of that issue and made sure my URL had that trailing
slash. Actually, playing a bit more with this I found out that whenever
uploading files, curl just takes the base name of the file and the
--ftp-create-dirs refers to the destination URL (the remote site). So
with I painfully arrived at the final code which now works:

---<---------------cut here---------------start-------------->---
UPLOADFILES=$(find -L ${WD} -name 'source' -prune -o ! -name '*~' \
    -type f -printf "-T %P ${URL}%P ")

cd "${WD}"
curl -v --disable-epsv --ftp-create-dirs -u ${USERPASSWD} ${UPLOADFILES}
---<---------------cut here---------------end---------------->---



> It's at that point that I think I'd just use rsync and be done with
> it. :)

I was considering that before digging into curl, but realized that would
take me longer to learn. It's in my todo now though! ;-)


Received on 2007-10-12