I am not able understand milestone 2 of module 3

After navigating to ftp_client directory my put command is getting successful but get command is showing this error:-

ftp> put upload.txt
local: upload.txt remote: upload.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
40 bytes sent in 0.00 secs (16.0289 kB/s)

ftp> get download.txt
local: download.txt remote: download.txt
200 PORT command successful. Consider using PASV.
550 Failed to open file.

Make sure you are in the correct directory when doing PUT and GET requests.

hey use it with using command pass and also make sure you have not defined any extra parameter in vsftpd.conf file and check these

@Mohak you haven’t uploaded the download.txt file so how can you download that file it’s not present on servers

@raghav9352 can you please explain more

The error means there is no download.txt in the directory from where you are trying to get the file

When you use the ftp command to connect to the QBox server, the default working directories are

  1. /home/crio-user - for server (check using pwd)
  2. The working directory of the terminal you executed ftp command - for client (check using !pwd)

While transferring files make sure you are doing so to the intended directories. To change working directory use

  1. cd - for server
  2. lcd - for client

And to see the contents of server and client directory after each transfer, do

  1. ls - for server directory
  2. !ls - for client directory

You download error is most likely because your server is in /home/crio-user directory. Do changes accordingly.

1 Like

You have to provide the proper directory while using get command. You have to provide the proper location of download.txt file.

After executing put upload.txt command from ftp_client directory it is uploading upload.txt file to /home/crio-user directory.

So I have to change this directory to /home/crio-user/workspace/ftp_server using cd and perform get upload.txt to get upload.txt file in ftp_server directory ?

Yes, you need to know where you are transferring files

@Mohak you can get your file anywhere but when you are uploading it will be better to give full directory path of your txt file

you can refer to this site to understand the local and target directory during transfer.

as @nabhanpv mentioned, you can use cd for target dir and lcd for local dir

Thank you so much guys !
I was so confused in this milestone.
Finally completed Module 3 :slight_smile: :slight_smile: