How and why to use DOS to transfer files

cDos-featuredIt comes in handy to know how to moves files from someone else's computer to your website (if you have one) so you can download them later when you get home. Over 10 years ago when I worked as an electronic technician, I used to take the weekly time sheet, send it via FTP to my website, then download it at home.

Note: FTP is an acronym which means file transfer protocol, and it's built into every computer.

See, there were only certain computers in the lab that had access to the server that had the time sheets. The one on my desk was one of them. If I happened to be away from my desk at 4:30 Friday afternoon, then I might have to wait while 10 others used my computer to fill out the time sheet in Excel, and then send it to the printer. These were Excel files. I just sent the document to my website, downloaded it, filled it out  at home, uploaded it, and then downloaded the filled out sheet Friday at 4pm before the rush started. My sheet was sent to the printer between 4-4:15pm. Sometimes this save me over and hour of waiting time. Who wants to hang around after work for an hour?

Of course this is only one scenario. There could be any number of reasons why you need move files from someone else's computer, to your server where you can download them later. After-all, some email providers won't let you receive attachments over 5 megabytes, and that isn't a very big file size by today's standards.

Any time you are connecting to a remote computer over the web and it isn’t an Anonymous FTP server you are going to have three pieces of information:

  •  The address of the host
  • Your Username
  • Your Password

How you connect to the host may vary a bit on individual servers, but these three pieces of information will always be required.

Also note that some FTP commands are redundant and there are sometimes two or more commands that do almost the same thing.

This tutorial assumes you are connecting to a server using a PC, but if you have downloaded this and use a MAC you will be happy to know that you can use a MAC for an FTP session. From a MAC terminal window you can run FTP. Terminal is found in the applications folder under Utilities. The terminal is a black window where you can type commands directly into the Mac system. Below is a list of common FTP commands:

Your first Session

 At your RUN prompt type: command. This will open a DOS window if you're using Windows. For this example, I'm using Windows 7.

You always learn better when you can have a “hands on” tutorial. If someone tells you how to do something, if you’re like me – you still don’t know.

Then when you actually do it you learn much quicker and understand better. So what we want to do is walk you through a couple of FTP session so you can get the “hang of it.” If you don’t have time right now, I would suggest you close this tutorial and come back to it when you have time.

ftp-commands

The first thing we need to do is open a DOS window. I will be FTPing into my website – you can follow along with your own. The first thing you are likely to see is C:\Users\Yourname>. If you're using an older operating  system you might see: C:\Windows>

ftp-1

 To make this easier to understand, let's suppose the file that I want to copy is on my "desktop" -- so in the FTP window I need to change the directory to where the file is located. So I type: cd desktop which now looks like this in the FTP client:

So are you all set? Check to make sure you have the file in the directory you have cd'd to. At the Prompt type dir. This will display a list of files and directories in your directory.

It is possible that using this DOS command the files scrolled up past the top of the DOS window and you may not be able to see them all. But you can tell DOS to only display one page of information at a time. To do this you would type: dir/p

This will display one page of information. If you don’t see the file there, just hit Enter to display the next page of information. The /p is known as a switch.

Now that we know the file is where it is supposed to be and that we are in the right directory (where we are supposed to be) we can start our FTP session. By default you will already be in ASCII mode which is the correct mode for transferring html and text files and scripts. So in this example I type into the DOS prompt: ftp homebusiness-websites.com

 Once you do that you will be connected to the server and prompted for your username and password. You type in your username and then the system will ask for your password. Then if successful you will receive this message back: 230 User username logged in. Note on Windows 7: your password will not be displayed as you enter it, and neither will any ‘*’s, so enter it carefully.

ftp-2

Using the example above you can see what commands I typed in and the information sent back to me from the server. The information sent back from the server starts with a server code such as 230, which basically means OK.

Once you have the message the file has been transferred, you can then type : bye -- and then exit. The first command disconnect you from the server, the second, closes the command prompt window.

Once you're home, you can follow the same procedure to retrieve the file, ifyou don't have an FTP client. But instead of typing put and the file name, you would type get and the file name.

This works great for text files and other files that are in the ASCII format. But if you wanted to transfer pdf files or Microsoft Word documents, you have to set the transfer to binary mode. By default, the FTP window is in ASCII mode. Once you login to the server, if you are going to transfer binary files you would enter bin at the command prompt, which tells the server you are transferring binary files. If you were uploading multiple files, you would do this at the command prompt: ftp>mput brian.doc form.mdb sterling.bmp. To retrieve these files at home you would use the command ftp>mget brian.doc form.mdb sterling.bmp.

 For those of you who didn't even realize you could do things like this with your computer, you may be missing out on a lot of things you could be doing. There are a log of books on Amazon that are geared towards people who want to learn more about their computers. They called the series "...for dummies" -- but there isn't anything stupid about these books, and they aren't really for dummies. They are geared with the end user in mind, someone who doesn't have a Bachelor of Computer Science. I've owned a few of these books and found them very helpful. Click here to see the list.

If you don’t want to miss any of these posts: on the right-hand side of the blog is a place where you can enter your email address, and I’ll send you any new posts by email. You’re not going to get spammed — I respect your privacy. All you will get is the new posts only. Note: any posts that contain video or other website technologies won’t be available in the email version of the posts.

You’re also welcome to share your comments below. Share your best computer tips!


Share

Comments

comments

Powered by Facebook Comments

Leave a Reply