You are not logged in.

#1 2011-02-02 15:31:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

help with cURL -X [SOLVED]

I'm trying to use the -X option with cURL to simply rename a directory on an ftp site but I can't get it right since the rename from command expects a rename to command to precede it.  I only know how to do this in two steps which doesn't work.

Example, I need to rename foo to bar

curl ftp://mysite.net -X 'RNFR foo' -u username:password
curl ftp://mysite.net -X 'RNTO bar' -u username:password

EDIT: Got it, use the -Q switch not -X:

curl ftp://mysite.net -Q "-RNFR foo" -Q "-RNTO bar" -u username:password

cURL rules.

Last edited by graysky (2011-02-02 16:42:29)

Offline

#2 2011-02-02 16:36:33

rezza
Member
From: Edinburgh, uk
Registered: 2004-07-08
Posts: 237

Re: help with cURL -X [SOLVED]

try

curl ftp://mysite.net -Q 'RNFR foo' -Q 'RNTO bar' -u username:password

Offline

#3 2011-02-02 16:43:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: help with cURL -X [SOLVED]

rezza - Thanks.  I didn't see your reply until after I edited my original post.

Offline

Board footer

Powered by FluxBB