Module 4 File Transfer

I am not able to download file from server using GET command.
I have started ftp in ftp_client directory and then I go to ftp_server inside ftp prompt. The 1 GB file is in ftp_server and in order to get it to ftp_client I use GET command but it shows 421 error and remote server closes the connection.
I can however PUT the file from ftp_client to ftp_server, ie. I can upload but the same is not the case for download.
Please could you help me out…

Maybe you need to start the ftp in passive mode.

I am getting “local: testfile remote: testfile
200 PORT command successful. Consider using PASV.
550 Failed to open file.” How i can resolve this problem ?

I tried in passive mode also !

Keep in mind that some versions are faulty, which is what you’re checking for.

So, am i supposed to switch to vsftpd_v2 for starting the server ?

You have to test all the versions provided. It may help to read through all the milestones first.

But i am not able to even transfer 1 gb file as of now !

"Transfer the 1 GB between the QBox server and client, try both upload and download "
What i understood from this step is we need to transfer 1GB file from ftp_server to ftp_client folder using get command. And then we need to again transfer that 1 GB file from ftp_client to ftp_sever using put command. Please tell if i am in the wrong direction.

Check if file is allocated 1 GB memory or not.
Look for file permissions as well.

Yes, its of 1 gb, has execution,read,write rights and both group and owner is root.

few important points-:
first create directory ftp_server and ftp_client in home/crio-user
then start vsftpd_v1(for milestone1) with vsftpd.config file
then in another terminal start ftp after the successful start
check your current directory in ftp and navigate to the home/crio-user/ftp_server
now suppose your 1GB file name is test.img and you want to download it
So, now change your lcd to home/crio-user/ftp_client
and now use get command to download test.img file.
important links -:
https://www.cyberciti.biz/faq/howto-create-lage-files-with-dd-command/
https://www.howtoforge.com/tutorial/how-to-use-ftp-on-the-linux-shell/

4 Likes

I followed all the steps, but still the get command not working

Also, when I created the file of 1 GB and run the ls command, the file size was 1 Gb. But soon after the put command, the file size became 0. Is it alright or was there a mistake in creating the file? I used the fallocate command to create the file.

I have been doing this for a while but getting this error
ftp> get test.img
local: test.img remote: test.img
227 Entering Passive Mode (127,0,0,1,63,212).
550 Failed to open file.
ftp>

Because the directory from which you are downloading and directory to which you are downloading is same. The file size became 0 bytes because you ended up overwriting the file.

1 Like

Issue Resolved. Thanks !

1 Like

Just think that if there is a file in your ftp_server then it means that file is in server already
So,Now if you use put command it will cause your file size to 0(Don’t know the exact reason behind it).So don’t use put command for your file present in ftp_server instead use put for your file present in ftp_client
edit:- got the reason mentioned in comment section by @Kunal

read my comment you will find your answer

but i am doing same as you said

try again @Vaishnavi_Singh has solved it and #me too :rofl: :joy:

i am still struct please help @Vaishnavi_Singh

ok tell me some more details it will help me in debugging
tell me the whole process after ftp 0.0.0.0 8081 command