cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: uploading / renaming - using anonymous / non anonymous account

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 13 Mar 2002 19:25:27 +0100 (MET)

On Wed, 13 Mar 2002, Erick Nuwendam wrote:

See my comments inlined below:

> =============================
> without the first slash
> sprintf(rnfr_cmd,"RNFR %s/%s", delivery_dir_path,"tmp_file") ;
> sprintf(rnto_cmd,"RNTO %s/%s", delivery_dir_path,"final_file") ;
>
> I get this :
>
> < 220 messira FTP server (Version 1.1.214.4 Wed Aug 23 03:38:25 GMT 2000)
> ready.
> > USER anonymous
> < 331 Guest login ok, send your complete e-mail address as password.
> > PASS anonymous
> < 230 Guest login ok, access restrictions apply.
> * We have successfully logged in
> > PWD
> < 257 "/" is current directory.
> * Entry path is '/'
> * Connected to localhost (127.0.0.1)
> > CWD pub/wmo
> < 250 CWD command successful.

Note here that libcurl automaticly changes directory to the target directory
before doing any transfer.

> > PASV
> < 227 Entering Passive Mode (127,0,0,1,194,127)
> * Connecting to localhost (127.0.0.1) port 49791
> * Connected the data stream!
> > TYPE I
> < 200 Type set to I.
> > STOR msg00000013.tmp

This of course means that this STOR operation puts the file in the directory
where we currently "stand".

> < 150 Opening BINARY mode data connection for msg00000013.tmp.
> < 226 Transfer complete.
> > RNFR pub/wmo/msg00000013.tmp

And then of curse, you should not try to use the full path here. The file
name is found as "msg00000013.tmp" here, without path.

> < 550 pub/wmo/msg00000013.tmp: No such file or directory.
> * Connection (#0) left alive
> 13/03 15:09:41 [emi_ext.c;341] QUOT string not accepted: RNFR
> pub/wmo/msg00000013.tmp
> 13/03 15:09:41 [NewSig.c;63] Cannot reach ftp_anony : QUOT string not
> accepted: RNFR pub/wmo/msg00000013.tmp
> 13/03 15:09:41 [emi_ext.c;254] RNFR delivery/msg00000001.tmp
> 13/03 15:09:41 [emi_ext.c;255] RNTO delivery/msg00000001
> < 220 messira FTP server (Version 1.1.214.4 Wed Aug 23 03:38:25 GMT 2000)
> ready.
> > USER erick
> < 331 Password required for erick.
> > PASS erick
> < 230 User erick logged in.
> * We have successfully logged in
> > PWD
> < 257 "/home/erick" is current directory.
> * Entry path is '/home/erick'
> * Connected to localhost (127.0.0.1)
> > CWD delivery
> < 250 CWD command successful.

Again, here it changed directory to the one named 'delivery'.

> > PASV
> < 227 Entering Passive Mode (127,0,0,1,194,130)
> * Connecting to localhost (127.0.0.1) port 49794
> * Connected the data stream!
> > TYPE I
> < 200 Type set to I.
> > STOR msg00000001.tmp
> < 150 Opening BINARY mode data connection for msg00000001.tmp.
> < 226 Transfer complete.
> > RNFR delivery/msg00000001.tmp
> < 550 delivery/msg00000001.tmp: No such file or directory.

... and here you prepended the directory name when you shouldn't have done so
as we already have that directory as current directory.

I hope this helps.

--
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-13