cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Skip/continue versus new FTP upload

From: Ignacio Vazquez-Abrams <ivazquez_at_ivazquez.net>
Date: Wed, 02 Mar 2005 19:16:35 -0500

On Thu, 2005-03-03 at 00:22 +0100, Daniel Stenberg wrote:
> On Wed, 2 Mar 2005, Ignacio Vazquez-Abrams wrote:
>
> > I've read the man pages, the FAQ, and the manual, but there's still
> > something I don't get. How can I cause cURL to continue an FTP upload if the
> > file exists, otherwise create a new file if it doesn't?
>
> You could try it, then you'd know! ;-)
>
> I believe uploading with resume to a file that doesn't already exist will be a
> fine "create new upload".

I tried several ways. None of them worked, but here's the closest
command I found:

curl --ftp-create-dirs -C - -n ftp://HOST/DIR -v -T FILE

And here's the result on a non-existent file:

* About to connect() to host port 21
* Trying X.X.X.X... * connected
* Connected to HOST (X.X.X.X) port 21
< 220---------- Welcome to Pure-FTPd [TLS] ----------
< 220-You are user number X of Y allowed.
< 220-Local time is now 18:10. Server port: 21.
< 220-This is a private system - No anonymous login
< 220 You will be disconnected after 15 minutes of inactivity.
> USER username
< 331 User username OK. Password required
> PASS password
< 230-User username has group access to: username
< 230-This server supports FXP transfers
< 230 OK. Current restricted directory is /
* We have successfully logged in
> PWD
< 257 "/" is your current location
* Entry path is '/'
> CWD DIR
< 250 OK. Current directory is /DIR
> EPSV
< 229 Extended Passive mode OK (|||51720|)
* Trying X.X.X.X... * connected
* Connecting to X.X.X.X (X.X.X.X) port 51720
* Connected the data stream with PASV!
> TYPE I
< 200 TYPE is now 8-bit binary
> SIZE FILE
< 550 Can't check for file existence
* Couldn't get remote file size
* Remembering we are in dir DIR
* Uploaded unaligned file size (0 out of 15384 bytes)
* Closing connection #0
curl: (32) Couldn't get remote file size

-- 
Ignacio Vazquez-Abrams <ivazquez_at_ivazquez.net>
http://fedora.ivazquez.net/

Received on 2005-03-03