I want to send a file to an FTP server (which is out of my control), and when using the interactive Linux command ftp
, this works fine:
[bf@localhost sudap]$ ftp ftp.example.net
Connected to ftp.example.net (1.1.1.1).
220 Serv-U FTP Server v15.3.0 ready...
Name (ftp.example.net:bf): USERNAME
331 User name okay, need password.
Password: ********
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put myfile.xlsx
local: myfile.xlsx remote: myfile.xlsx
227 Entering Passive Mode (13,93,54,131,92,38)
150 Opening BINARY mode data connection for myfile.xlsx.
226 Transfer complete. 39,547 bytes transferred. 123.78 KB/sec.
39547 bytes sent in 0.139 secs (284.45 Kbytes/sec)
However, when I do the same with the lftp
command (because I need this to run in a script), it fails to upload, with a bit of a cryptic message:
[bf@vps sudap]$ lftp
lftp :~> connect ftp://USERNAME:[email protected]
lftp [email protected]:~> put myfile.xlsx
put: Access failed: 550 /: No such file. (myfile.xlsx)
How could I possibly fix this?