cURL / Mailing Lists / curl-users / Single Mail

curl-users

how to avoid ftp automatic redirects

From: Seb <spluque_at_gmail.com>
Date: Wed, 10 Oct 2007 11:19:24 -0500

Hi,

I recently encountered a problem uploading files to a ftp server, which
automatically redirects me to a particular directory after logging in:

---<---------------cut here---------------start-------------->---
curl --disable-epsv -u user:pwd -T test.txt ftp://root.dir/rest/of/path

* About to connect() to root.dir port 21 (#0)
* Trying 130.179.16.50... connected
* Connected to root.dir (130.179.16.50) port 21 (#0)
< 220 root.dir FTP server ready.
> USER user
< 331 Password required for user.
> PASS pwd
< 230 User user logged in.
> PWD
< 257 "/home/u3/user" is current directory.
* Entry path is '/home/u3/user'
> CWD rest
< 550 rest: No such file or directory.
* Server denied you to change to the given directory
* Uploaded unaligned file size (0 out of 1470 bytes)
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connection #0 to host root.dir left intact

curl: (9) Server denied you to change to the given directory
> QUIT
< 221-You have transferred 0 bytes in 0 files.
< 221-Total traffic for this session was 281 bytes in 0 transfers.
< 221-Thank you for using the FTP service on root.dir.
< 221 Goodbye.
* Closing connection #0
---<---------------cut here---------------end---------------->---

I modified the urls for privacy, keeping the problem intact.

The issue is that the server automatically redirects to /home/u3/user, and
then the /rest/of/path of the url is no longer valid. Any ideas on how to
deal with this welcome. Thanks.

-- 
Seb
Received on 2007-10-10