FTP Commands to upload file

Sometimes you might end up with a machine where the ftp tools are not accessible.  Here we can use the ftp.exe command line tool along with Windows Operating system.

Step1:

Type ftp in the windows run command box.

image

Step2:

In the appearing command line window type open www.yoursite.com. (I am typing my site named www.fortuneanalyst.com)

It will be prompting for the user name and password.

image

Step3:

Type your username and press enter.  Wait for 2 seconds and you will be prompted for the password.  Type the correct password and press enter.  Wait for 2 seconds and if the password is valid you will be getting the message”User * logged in”.

Note: The password typed won’t be displayed on the screen.

image

If you can see the above message Congratulations!!! You have successfully logged in.

Now we can move to the next step

Step 4:

Type the command dir in the above screen.  Wait for 2 seconds.  You will be listed with the directories and files in the root folder.

Step 5:

Create a new directory named “fxlogics”.  For creating a new directory use command

mkdir fxlogics

Step 6:

Copy files to the new directory.

First we have to change the directory to fxlogics.  For this type the command

cd fxlogics

Step 7:

You can ensure you are in the correct directory by entering the dir command again.

Step 8: Upload File

Here you are uploading a file from the local computer to the ftp site’s current directory.

Use command put filepath

Alternatively you can type put and drag and drop the file from explorer to the command window.  So the exact path will be shown correctly.

Eg: put c:readme.txt

Step 9:

Ensure the file is copied correctly by typing the dir command again.

If you can see the file in the command screen you have uploaded the file successfully.

Step 10:

Close the command window by typing the quit command.

More Commands

Command Description Example
help Shows the commands list help
quit Closes the ftp window quit
dir Displays the directory contents dir
cd Change directory cd mydir
mkdir Make Directory mkdir newdirname
put Uploads a file from the local file system. put “c:program filesa.txt”
delete Deletes the file from the directory delete “the file name.exe”

 

Tips

You can use the up and down arrow while in the command window, to traverse between the commands typed.  It will save the time and effort to type the command again.

Hope you enjoyed the article :)

2 thoughts on “FTP Commands to upload file

  1. Sammie Asava says:

    This is a great FTP Library for C#, it is reasonably priced too:
    https://www.kellermansoftware.com/p-39-net-ftp-library.aspx

    1. Jean Paul says:

      Thank You Mr. Asava for sharing..

Leave a Reply

Your email address will not be published. Required fields are marked *